<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><br></div><div style="font-family: arial,helvetica,sans-serif;">There are two Perl scripts only different by the first line. Why the one without -w in the #! line cannot find itself but the own with -w can?<br></div><div style="font-family: arial,helvetica,sans-serif;"><br></div><div style="font-family: arial,helvetica,sans-serif;">OS: Linux 2.4.5 #6 SMP</div><div style="font-family: arial,helvetica,sans-serif;">Perl:  v5.8.0<br></div><div><br></div><div><br></div><div>/tmp>$ sdiff test.pl test1.pl<br>#!/usr/local/bin/perl                                         | #!/usr/local/bin/perl -w<br>system ('which
 perl');                                          system ('which perl');<br>print "hi\n";                                                   print "hi\n";<br></div><div><br></div><div>/tmp>$ test.pl<br>ksh: test.pl: No such file or directory<br>:/tmp>$ ./test.pl<br>ksh: ./test.pl: No such file or directory<br>/tmp>$ /tmp/test.pl<br>ksh: /tmp/test.pl: No such file or directory<br>/tmp>$ perl test.pl<br>/usr/local/bin/perl<br>hi</div><div><br></div><div>/tmp>$ 
 test1.pl<br>/usr/local/bin/perl<br>hi<br><br></div><div><br></div><div><br></div></div></body></html>