develooper Front page | perl.beginners | Postings from April 2002

RE: I can't get this to run!

Thread Next
From:
Shaun
Date:
April 27, 2002 15:20
Subject:
RE: I can't get this to run!
Message ID:
CIEFLCAPAEKPDDFKAOGMEEJNDOAA.shaun@s-sloan.demon.co.uk
Hi,

> I can't get this cgi script I downloaded to run...
Try checking the file for ^Ms at the end of the line with:
$ cat -v /usr/lib/cgi-bin/agbot/agbot.cgi

I think you will find that it will have:
#!/usr/bin/perl^M

Then you will have to strip off all the ^Ms from all the lines with:
$ perl -pi.bak -e 's/\^M//g' agbot.cgi
Note: For the ^M you will need to key Ctrl+v and then Ctrl+m this should
then print ^M
This will strip off the ^Ms and create a backup file called agbot.cgi.bak

>  $ perl /usr/lib/cgi-bin/agbot/agbot.cgi

> and it works just fine..  Huh?  I don't get it..
That's because the shebang line is ignored when you prefix the script with
the perl command.

Hth,

Shaun
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 19/04/2002


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About