Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
(Ovid) Re: Odd -w behavior on scripts written on Win32 platformby Ovid (Cardinal) |
on Jan 03, 2002 at 01:04 UTC ( [id://135802]=note: print w/replies, xml ) | Need Help?? |
Your problem is that Win32 systems use a \r\n for a line terminator, but Unix like systems only use the newline. One way to fix this is to FTP the scripts over in ASCII mode, or use the following one-liner on the script:
The reason it doesn't find Perl without the command line switch is that it is actually looking for 'perl\r', but adding the switch puts whitespace after 'perl', thus allowing it to work. Regardless, I've found that even adding the switch can still cause scripts to fail mysteriously if the line-endings are wrong. Best to strip them. Cheers, Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In Section
Seekers of Perl Wisdom
|
|