<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Yes. If it is not, it should get different error message.</span></div><div><br><span></span></div><div><span>I remember I did run into similar issue before. It was related to environment setting. <br></span></div><div><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> imran javaid <imranjj@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> Chicago.pm chatter <chicago-talk@pm.org><br><b><span style="font-weight: bold;">Sent:</span></b> Thursday, June 16, 2011 3:54 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Chicago-talk] Perl script cannot find itself?<br></font><br>
<div id="yiv1339215387">is <a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a> executable?<br><div><font class="yiv1339215387Apple-style-span" face="'Courier New', courier, monaco, monospace, sans-serif"><br></font></div><div><font class="yiv1339215387Apple-style-span" face="'Courier New', courier, monaco, monospace, sans-serif">-imran<br>
</font><br><div class="yiv1339215387gmail_quote">On Thu, Jun 16, 2011 at 3:47 PM, tiger peng <span dir="ltr"><<a rel="nofollow" ymailto="mailto:tigerpeng2001@yahoo.com" target="_blank" href="mailto:tigerpeng2001@yahoo.com">tigerpeng2001@yahoo.com</a>></span> wrote:<br><blockquote class="yiv1339215387gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><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 <a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a> <a rel="nofollow" target="_blank" href="http://test1.pl">test1.pl</a><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>$ <a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a><br>
ksh: <a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a>: No such file or directory<br>:/tmp>$ ./<a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a><br>ksh: ./<a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a>: No such file or directory<br>
/tmp>$ /tmp/<a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a><br>ksh: /tmp/<a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a>: No such file or directory<br>/tmp>$ perl <a rel="nofollow" target="_blank" href="http://test.pl">test.pl</a><br>
/usr/local/bin/perl<br>hi</div><div><br></div><div>/tmp>$ 
 <a rel="nofollow" target="_blank" href="http://test1.pl">test1.pl</a><br>/usr/local/bin/perl<br>hi<br><br></div><div><br></div><div><br></div></div></div><br>_______________________________________________<br>
Chicago-talk mailing list<br>
<a rel="nofollow" ymailto="mailto:Chicago-talk@pm.org" target="_blank" href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
http://mail.pm.org/mailman/listinfo/chicago-talk<br></blockquote></div><br></div>
</div><br>_______________________________________________<br>Chicago-talk mailing list<br><a ymailto="mailto:Chicago-talk@pm.org" href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br><br></div></div></div></body></html>