<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Thanks, You are right. (I thought after using vi to edit it, the \r should be gone)<br></div><div><br><span></span></div><div><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">/tmp></span><span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">$ od -c test.pl</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000000   #   !   /   u   s   r   /   l   o   c   a   l   /   b   i   n</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
 New,courier,monaco,monospace,sans-serif;">0000020   /   p   e   r   l  <font size="3"><span style="background-color: rgb(255, 0, 0);">\r </span> </font>\n   s   y   s   t   e   m       (   '</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000040   w   h   i   c   h       p   e   r   l   '   )   ;  \r  \n   p</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000060   r   i   n  
 t       "   h   i   \   n   "   ;  \r  \n</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000076</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">/tmp>$ perl -i -pe 's/\r//' test.pl</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">$ od -c test.pl</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000000   #   !   /   u   s   r   /   l  
 o   c   a   l   /   b   i   n</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000020   /   p   e   r   l  \n   s   y   s   t   e   m       (   '   w</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000040   h   i   c   h       p   e   r   l   '   )   ;  \n   p   r   i</span><br style="font-family: Courier
 New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000060   n   t       "   h   i   \   n   "   ;  \n</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">0000073</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">/tmp>$  test.pl</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">/usr/local/bin/perl</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
 New,courier,monaco,monospace,sans-serif;">hi</span><br></span></div><div><span><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> Clyde Forrester <clydeforrester@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> Friday, June 17, 2011 9:42 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Chicago-talk] Perl script cannot find itself?<br></font><br>
I generally use the od -c command to check for stuff like that.<br>If you see "0d 0a" combinations instead of just "0a", then you have carriage returns.<br><br>od -c <a target="_blank" href="http://test.pl">test.pl</a><br><br>c4<br><br>tiger peng wrote:<br>> I checked them with vi's list command, there is no cartridge return character in the scripts.<br>> <br>> ------------------------------------------------------------------------<br>> *From:* Andrew Rodland <<a ymailto="mailto:andrew@cleverdomain.org" href="mailto:andrew@cleverdomain.org">andrew@cleverdomain.org</a>><br>> *To:* <a target="_blank" href="http://Chicago.pm">Chicago.pm</a> chatter <<a ymailto="mailto:chicago-talk@pm.org" href="mailto:chicago-talk@pm.org">chicago-talk@pm.org</a>><br>> *Sent:* Thursday, June 16, 2011 9:19 PM<br>> *Subject:* Re: [Chicago-talk] Perl script cannot find itself?<br>> <br>> On Thursday, June 16, 2011 04:47:39 PM tiger peng
 wrote:<br>>  > There are two Perl scripts only different by the first line. Why the one<br>>  > without -w in the #! line cannot find itself but the own with -w can?<br>> <br>> Because you saved the file with windows line-endings, and there's a \cM at the<br>> end of every line. In the first case, the kernel is looking for<br>> "/usr/local/bin/perl\cM" and can't find it. In the second case the kernel is<br>> looking for "/usr/local/bin/perl" and running it with an argument of "-w\cM",<br>> which is harmless.<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>http://mail.pm.org/mailman/listinfo/chicago-talk<br><br><br></div></div></div></body></html>