[Chicago-talk] Perl script cannot find itself?

Clyde Forrester clydeforrester at gmail.com
Fri Jun 17 07:42:13 PDT 2011

I generally use the od -c command to check for stuff like that.
If you see "0d 0a" combinations instead of just "0a", then you have 
carriage returns.

od -c test.pl


tiger peng wrote:
> I checked them with vi's list command, there is no cartridge return 
> character in the scripts.
> ------------------------------------------------------------------------
> *From:* Andrew Rodland <andrew at cleverdomain.org>
> *To:* Chicago.pm chatter <chicago-talk at pm.org>
> *Sent:* Thursday, June 16, 2011 9:19 PM
> *Subject:* Re: [Chicago-talk] Perl script cannot find itself?
> 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