In How to make a CPAN module Ditribution I noted that there are issues with ^M ie the CR part or CRLF that you get for a line ending on Win32 when you move such a script to Linux. A monk just noted that he was less than convinced. I was thinking scripts (rather than Modules but you always have test scripts in a distro). Here is the evidence relating to the problem I get:
[root@devel3 root]# cat bad.pl #!/usr/bin/perl print "Hello Errors!\n" [root@devel3 root]# perl -pe 's/\015/^M/' bad.pl #!/usr/bin/perl^M print "Hello Errors!\n"^M [root@devel3 root]# ./bad.pl : bad interpreter: No such file or directory [root@devel3 root]# perl -pi -e 's/\015//' bad.pl [root@devel3 root]# ./bad.pl Hello Errors! [root@devel3 root]# perl -pe 's/\015/^M/' bad.pl #!/usr/bin/perl print "Hello Errors!" [root@devel3 root]#
So you can see that the \015 is present and causes the breakage shown which goes away when you make the \015s go away. Q: Why is it so?
cheers
tachyon
In reply to Why does Perl choke on \015 ^M chars by tachyon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |