NewtownGuy
Technical User
Hello,
I'm trying to get my first perl script running. I have two Linux test machines, and both are giving me similar errors when I access them from the command line via PuTTy from a Windows machine, and also from IE6 on the Windows machine.
The two test machines are:
1) Linux Fedora Core 2, Apache 2.0.49 (Fedora) Server, Perl (5.8.3), HTTP listen port 8000, on 192.168.192.94 on my LAN
2) Linux Fedora Core 3, Apache 2.0.52 (Fedora) Server, Perl (5.8.5), HTTP listen port 8000, on 192.168.192.135 on my LAN
My first.pl test script is:
When I type this from /var/ where first.pl is located:
./first.pl
I get this:
": No such file or directory
When I type this from the same location:
perl first.pl
It runs just fine.
From Fedora Core 2, when I type:
which perl
I get /usr/bin/perl, which is consistent with the first line of the script.
When I type this into the URL line in IE6 on my PC on the same LAN as the Linux machine:
I get an Internal Server Error in IE6 and I get this from the HTTP error_log on the Fedora Core 2 machine:
[date code] Can't open perl script "\r". No such file or directory
[date code] Premature end of script headers. first.pl
When I type a similar line into the URL line in IE6 on my PC on the same LAN as the Linux machine, I get an Internal Server Error in IE and I get this from the HTTP error_log on the Fedora Core 3 machine:
[date code] Can't open perl script "\r". No such file or directory
[date code] Use -S to search $PATH for it
[date code] Premature end of script headers. first.pl
I set the permission for the perl script to 777. Since the root directory for the HTTP server is /var/ and the script is in /var/ I tried using ../cgi-bin in the URL but it results in Page Not Found in IE.
I have no idea where the \r is coming from.
How do I fix these problems ?
Thank you.
I'm trying to get my first perl script running. I have two Linux test machines, and both are giving me similar errors when I access them from the command line via PuTTy from a Windows machine, and also from IE6 on the Windows machine.
The two test machines are:
1) Linux Fedora Core 2, Apache 2.0.49 (Fedora) Server, Perl (5.8.3), HTTP listen port 8000, on 192.168.192.94 on my LAN
2) Linux Fedora Core 3, Apache 2.0.52 (Fedora) Server, Perl (5.8.5), HTTP listen port 8000, on 192.168.192.135 on my LAN
My first.pl test script is:
Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World\n";
When I type this from /var/ where first.pl is located:
./first.pl
I get this:
": No such file or directory
When I type this from the same location:
perl first.pl
It runs just fine.
From Fedora Core 2, when I type:
which perl
I get /usr/bin/perl, which is consistent with the first line of the script.
When I type this into the URL line in IE6 on my PC on the same LAN as the Linux machine:
I get an Internal Server Error in IE6 and I get this from the HTTP error_log on the Fedora Core 2 machine:
[date code] Can't open perl script "\r". No such file or directory
[date code] Premature end of script headers. first.pl
When I type a similar line into the URL line in IE6 on my PC on the same LAN as the Linux machine, I get an Internal Server Error in IE and I get this from the HTTP error_log on the Fedora Core 3 machine:
[date code] Can't open perl script "\r". No such file or directory
[date code] Use -S to search $PATH for it
[date code] Premature end of script headers. first.pl
I set the permission for the perl script to 777. Since the root directory for the HTTP server is /var/ and the script is in /var/ I tried using ../cgi-bin in the URL but it results in Page Not Found in IE.
I have no idea where the \r is coming from.
How do I fix these problems ?
Thank you.