<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div><span>I'd better to dig more about the vim, the tool I used every day.<br></span></div><div><br></div><div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 12pt;"><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> Brian Katzung <briank@kappacs.com><br><b><span style="font-weight: bold;">To:</span></b> chicago-talk@pm.org<br><b><span style="font-weight: bold;">Sent:</span></b> Friday, June 17, 2011 11:13 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Chicago-talk] Perl script cannot find itself?<br></font><br>
<div id="yiv629565482">
When the line endings are \r\n instead of just \n, vim sets the
fileformat to dos instead of unix. This is why list mode didn't
reveal them. To fix them using vim:<br>
<br>
vim <a target="_blank" href="http://test.pl">test.pl</a><br>
:se ff=unix (short form of ":set fileformat=unix")<br>
:wq<br>
<br>
- Brian<br>
<br>
On 2011-06-17 10:19, tiger peng wrote:
<blockquote type="cite">
<div style="color:rgb(0, 0, 0);background-color:rgb(255, 255,
255);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 <a rel="nofollow" class="yiv629565482moz-txt-link-rfc2396E" ymailto="mailto:clydeforrester@gmail.com" target="_blank" href="mailto:clydeforrester@gmail.com"><clydeforrester@gmail.com></a><br>
<b><span style="font-weight:bold;">To:</span></b>
<a target="_blank" href="http://Chicago.pm">Chicago.pm</a> chatter <a rel="nofollow" class="yiv629565482moz-txt-link-rfc2396E" ymailto="mailto:chicago-talk@pm.org" target="_blank" href="mailto:chicago-talk@pm.org"><chicago-talk@pm.org></a><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 rel="nofollow" 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 rel="nofollow" ymailto="mailto:andrew@cleverdomain.org" target="_blank" href="mailto:andrew@cleverdomain.org">andrew@cleverdomain.org</a>><br>
> *To:* <a rel="nofollow" target="_blank" href="http://Chicago.pm">Chicago.pm</a> chatter <<a rel="nofollow" ymailto="mailto:chicago-talk@pm.org" target="_blank" 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 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>
<br>
<br>
</div>
</div>
</div>
<pre><fieldset class="yiv629565482mimeAttachmentHeader"></fieldset>
_______________________________________________
Chicago-talk mailing list
<a rel="nofollow" class="yiv629565482moz-txt-link-abbreviated" ymailto="mailto:Chicago-talk@pm.org" target="_blank" href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a>
<a rel="nofollow" class="yiv629565482moz-txt-link-freetext" target="_blank" href="http://mail.pm.org/mailman/listinfo/chicago-talk">http://mail.pm.org/mailman/listinfo/chicago-talk</a></pre>
</blockquote>
<br>
<pre class="yiv629565482moz-signature">--
Brian Katzung, Kappa Computer Solutions, LLC
Leveraging UNIX, GNU/Linux, open source, and custom
software solutions for business and beyond
Phone: 877.367.8837 x1 http://www.kappacs.com
</pre>
</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>