[Chicago-talk] Perl script cannot find itself?

imran javaid imranjj at gmail.com
Thu Jun 16 13:54:48 PDT 2011


is test.pl executable?

-imran

On Thu, Jun 16, 2011 at 3:47 PM, tiger peng <tigerpeng2001 at yahoo.com> wrote:

>
> 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?
>
> OS: Linux 2.4.5 #6 SMP
> Perl:  v5.8.0
>
>
> /tmp>$ sdiff test.pl test1.pl
> #!/usr/local/bin/perl                                         |
> #!/usr/local/bin/perl -w
> system ('which perl');                                          system
> ('which perl');
> print "hi\n";                                                   print
> "hi\n";
>
> /tmp>$ test.pl
> ksh: test.pl: No such file or directory
> :/tmp>$ ./test.pl
> ksh: ./test.pl: No such file or directory
> /tmp>$ /tmp/test.pl
> ksh: /tmp/test.pl: No such file or directory
> /tmp>$ perl test.pl
> /usr/local/bin/perl
> hi
>
> /tmp>$  test1.pl
> /usr/local/bin/perl
> hi
>
>
>
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20110616/2353465a/attachment.html>


More information about the Chicago-talk mailing list