Re: Perl problems
by neshura (Chaplain) on Mar 09, 2000 at 07:30 UTC
|
check the path in the first line of your scripts, make sure it is correct
also run your script from the command line by saying "./script.pl" instead of "script.pl".
if all else fails, post your code and describe the errors that you are getting when running from the browser
e-mail neshura | [reply] |
Re: Perl problems
by Anonymous Monk on Mar 11, 2000 at 09:40 UTC
|
I had the same problem just today. I tried chmod +x, and it still would just show the text of the perl script. The box I'm hosting the site on isn't mine, but my bosses and I wasn't sure which extentions he was allowing executable rights. I changed the .pl to .cgi and it worked like a charm. You need to ask the sysadmin what extentions are executable and where Perl is in case your first line is wrong. That was my first problem. | [reply] |
RE: Perl problems
by Anonymous Monk on Mar 10, 2000 at 06:38 UTC
|
whereever you specified perl in the #! is wrong, you might
have put #!/bin/perl but it is really in /usr/local/bin.
do a which perl to find out where perl is on your ISP.
gabe-san | [reply] |
|
|
Someone suggested changing .pl to .cgi, so I did. I then ran the script through telnet and it ran like it was supposed to. However, when I tried to use my browsers it gives me an internal error message. I have never had a case where it would run through telnet and not the browser. Any thoughts???
Thanks
Scott
| [reply] |
|
|
print "Content-Type: text/html\n\n";
Read the Idiot's Guide. | [reply] [d/l] |
RE: Perl problems
by Anonymous Monk on Mar 10, 2000 at 08:19 UTC
|
what's the actual command you typed in to run the perl script?
| [reply] |
RE: Perl problems
by Anonymous Monk on Mar 09, 2000 at 09:30 UTC
|
I have heard that this kind of problem may be caused by ftp'ing the file in binary mode instead of text mode. Crazy? maybe if you are an old time Solaris admin, but this is what _appears_ to cause the problem on Linux | [reply] |
|
|
yes, could be a transfer problem.
Try to find out if the script first line contain at the end a \r character.
You can see that viewing the script with some editor (joe, vim etc...), or viewing
hexa).
Also could be a path problem.
| [reply] |
|
|
If it is a ascii-binary transfer problem, you can quickly
fix it (without uploading again) with
perl -pi -e 's/\r//g' script.pl
If that's not the problem, running the above command won't
hurt anything anyway.
| [reply] |
Re: Perl problems
by Anonymous Monk on Mar 10, 2000 at 04:33 UTC
|
Everytime I have seen this error it was due to 1 of 2
things: (1) "." isn't in your path and you have to run
the command using the form "./command.pl" or (2) the first
line of the perl command was #!/bin/perl, for example, but
there wasn't perl or a link to perl in /bin. You have
to make sure the path is correct. | [reply] |
Re: Perl problems
by btrott (Parson) on Mar 09, 2000 at 23:20 UTC
|
| [reply] |