[Chicago-talk] Perl script cannot find itself?

Andrew Rodland andrew at cleverdomain.org
Thu Jun 16 19:19:01 PDT 2011


On Thursday, June 16, 2011 04:47:39 PM tiger peng 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?

Because you saved the file with windows line-endings, and there's a \cM at the 
end of every line. In the first case, the kernel is looking for 
"/usr/local/bin/perl\cM" and can't find it. In the second case the kernel is 
looking for "/usr/local/bin/perl" and running it with an argument of "-w\cM", 
which is harmless.


More information about the Chicago-talk mailing list