I'm wondering if anyone can clarify this for me:
When I was first learning Perl I started all my files off with a fairly basic shebang line:
My ActivePerl was installed in C:\Perl\bin\perl but Windows didn't care because it was going by file extensions, but when uploaded to *nix servers this line would work fine.
I had a web host once on a Linux server and my scripts were all giving these 500 Internal Server Errors. The files were formatted correctly and uploaded correctly, had the correct permissions to execute, but I couldn't tell what the problem was and so I searched the forums of this web hosting company. Somebody said to change the shebang line to this:
Sure enough, adding the -w flag allowed the script to execute just fine.
Because of that I got into the habit of always using -w in my shebang line, and every once in a while I'd have someone ask me why their CGI isn't working and I'd take a look, recommend them to add the -w and then it starts working. But the last time I actually encountered this problem was years ago.
My brother (who's not much of a programmer) was putting together a basic Perl script to e-mail him the results of a form. It wasn't working on his server so he sent me it. He had it formatted in Unicode and so Perl was complaining about unrecognized characters, so I converted it to ASCII and then Perl complained of syntax errors. Fixing them, the Perl syntax check passed just fine. So then I tested the CGI on my local Apache server running on my Fedora 9 machine, and it was giving me these server errors.
(the error was something to that extent... my VPS web server running CentOS 5 with a custom build of Apache doesn't mind the absence of -w, and my work PC running Fedora 9 [possibly with a custom Apache] doesn't mind either, but my home PC running Fedora 9 does as does various web servers I've encountered over the years)
Why do some servers require a -w on this line and give a server error if it's not there?
-------------
Cuvou.com | My personal homepage
When I was first learning Perl I started all my files off with a fairly basic shebang line:
Code:
#!/usr/bin/perl
My ActivePerl was installed in C:\Perl\bin\perl but Windows didn't care because it was going by file extensions, but when uploaded to *nix servers this line would work fine.
I had a web host once on a Linux server and my scripts were all giving these 500 Internal Server Errors. The files were formatted correctly and uploaded correctly, had the correct permissions to execute, but I couldn't tell what the problem was and so I searched the forums of this web hosting company. Somebody said to change the shebang line to this:
Code:
#!/usr/bin/perl -w
Sure enough, adding the -w flag allowed the script to execute just fine.
Because of that I got into the habit of always using -w in my shebang line, and every once in a while I'd have someone ask me why their CGI isn't working and I'd take a look, recommend them to add the -w and then it starts working. But the last time I actually encountered this problem was years ago.
My brother (who's not much of a programmer) was putting together a basic Perl script to e-mail him the results of a form. It wasn't working on his server so he sent me it. He had it formatted in Unicode and so Perl was complaining about unrecognized characters, so I converted it to ASCII and then Perl complained of syntax errors. Fixing them, the Perl syntax check passed just fine. So then I tested the CGI on my local Apache server running on my Fedora 9 machine, and it was giving me these server errors.
Code:
File not found: can't exec '/home/kirsle/public_html/test/member.pl'
Premature end of script headers at /home/kirsle/public_html/test/member.pl
(the error was something to that extent... my VPS web server running CentOS 5 with a custom build of Apache doesn't mind the absence of -w, and my work PC running Fedora 9 [possibly with a custom Apache] doesn't mind either, but my home PC running Fedora 9 does as does various web servers I've encountered over the years)
Why do some servers require a -w on this line and give a server error if it's not there?
-------------
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'