in reply to
Re: $/ is playing havoc with my script.
in thread $/ is playing havoc with my script.
I believe TheDamian recommends in Perl Best Practices to use msx on every regex. Of course I don't know if that's what is going on here, but I find it to be good advice; it doesn't hurt anything to have them on there, and if you add a "." to your regex someday it'll work by default (assuming that "works" means ". matches a newline", which it does to me intuitively). I've been bitten by "." not matching a newline before.
According to Apocalypse 5, in Perl6 "." will always match newline, and ^ and $ will always have a single meaning, so we thankfully won't have this problem.