[thelist] PERL? - was [F2S Announcement]
Dean Mah
dmah at shaw.ca
Thu Dec 6 13:18:40 CST 2001
Daniel J. Cody writes:
> > I'd really like to play with Perl too ...
> >
> > Is there a short article or note or test file somewhere with a
> > step-by-step, ["make the shebang line look like this", "then store the
> > file in a directory called that"], that could get me going in Perl?
>
> hrmm. i'm not the biggest perl guy, but maybe garrett c, anthony,
> dean, or any of the other perl gurus can point some out :)
- For the shebang line, it's the typical #!/usr/bin/perl -w
- Depending on how Dan configures your access, put .cgi on the end of
your file, make sure that it is world executable, and you should be
good. If Dan restricts you to running CGI out of a certain
directory, he'll have to let you know. (Oh, everything needs to be
in the public_html directory but that should be obvious.)
For a test file:
------------------------[ Cut Here ]----------------------------------
#!/usr/bin/perl -w
$| = 1;
use strict;
print <<END;
Content-type: text/html
<html>
<head><title>Hello World</title></head>
<body>
<h1>Hello World</h1>
</body>
</html>
END
exit(0);
------------------------[ Cut Here ]----------------------------------
Save it as helloworld.cgi in your public_html directory, chmod o+rw,
and then access it at:
http://members.evolt.org/user/helloworld.cgi
Hope that helps,
Dean
More information about the thelist
mailing list