How to run a perl script?
http://99-bottles-of-beer.net/language-perl-737.html
OK, can someone tell me what to do to set up this script? It's in perl, and uses eye drops...
http://99-bottles-of-beer.net/language-perl-737.html
OK, can someone tell me what to do to set up this script? It's in perl, and uses eye drops...
Abhishek Reddy posted this at 12:00 — 22nd October 2006.
He has: 3,348 posts
Joined: Jul 2001
What operating system are you in? Do you have Perl installed?
All you need to do is put the code on that page into a new file (maybe call it 99bottles.pl). Then run perl 99bottles.pl from the command line.
How you go about doing that last bit depends on your OS and what shell you use.
If you're trying to do this on a server, with hypertext output, then it's slightly different. You'll need CGI on your server -- you'll probably have a "cgi-bin" directory. Add #!/usr/bin/perl -wT as the first line of your 99bottles.pl file, and print "Content-type: text/html\n\n"; as the second line. Put the file in your CGI-enabled directory, and ensure it has the right permissions (755). Finally, visit it in your browser.
The script itself doesn't depend on EyeDrops. It was generated with the help of EyeDrops, and in its presented form works with just Perl.
Abhishek Reddy posted this at 11:56 — 23rd October 2006.
He has: 3,348 posts
Joined: Jul 2001
Here's an expanded version that prints via CGI nicely:
#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
print "<pre>";
''=~( '(?{' .('`' |'%') .('[' ^'-')
<strong><em>[...snip...]</em></strong>
'`'|('%')). '++\\$="})' );$:=('.')^ '~';$~='@'| '(';$^=')'^ '[';$/='`';
print "</pre>";
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.