in reply to Why does Perl choke on \015 ^M chars
Paladin's answer is absolutely correct, and I see that you've even acknowledged that you understand why. I thought it might be worth underscoring the fact that, contrary to your question's title, this is not perl choking on ^M, it's the shell. This is an important distinction, and it's something that could use explicit mention. Perl should work fine with ^M's, no matter what platform. Incidentally, another trick besides -w (or getting rid of the ^M, which is the real solution) is to put a space at the end of the line, so it ends up as:
#!/usr/bin/perl ^M
|
|---|