Originally posted by: notfred
it basically says "If the string ends in 'P' or 'L'..."
What's annoying is that it works on one machine and not another....
Strictly speaking, it doesn't. You're pattern matching on a string that contains P or L following by a newline character. Depending on the context for $_, this can be true for a string which does not end in P or L (i.e. "A string which ends in P\nmore characters in a string"), unless you've previously guaranteed that $_ splits its input following a newline character.
My guess would be that for some reason, the server environment chops the newline you're expecting.
Might be obvious, but you should be dumping the value of $_ to a log to see why the value you're expecting isn't there.