[cs615asa] Question: Perl

Jan Schaumann jschauma at cs.stevens.edu
Thu Apr 16 12:19:46 EDT 2009


Chih-Yuan Lee <clee9 at stevens.edu> wrote:
 
> I found a very strang thing. 
> Finally, I fixed this problem using a strange way.
> Actually, I use "gedit" to write my script at the beginning.
> 
> Now I tried to use "vi" to open my script. 
> Then I rewrote "#!/usr/bin/env perl" again and deleted the previous 
> one. It works well without any problem on lab.cs.stevens.edu machine. 
> 
> But I still did not get what is going on for this problem. Does the 
> "gedit" cause this problem?? Does anyone know why this happened??

I'll guess that you originally created the file on Windows, then copied
it to the host.  If that is the case, the file will contain \r\n at the
end of each line (instead of just \n).  Some editors try to be "helpful"
and switch to "dos" mode when they notice this, and will leave these
end-of-line characters in place.

vi being a sane editor does not do such shenanigans and just uses a
normal unix eol.

Lesson learned: don't develop on one platform if you're trying to deploy
on another.

-Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : https://lists.stevens.edu/cgi-bin/mailman/private/cs615asa/attachments/20090416/f6c79359/attachment.pgp 


More information about the Cs615asa mailing list