It's true, dammit, true! Not false!

notfred

Lifer
Feb 12, 2001
38,241
4
0
if ($_ =~ m/[PL]\n/){

It should evaluate TRUE! it runs FINE on my PC and is always false when I run it on the server. It ran FINE until this morning, when I changed NOTHING and then it stopped working. ARGHH!!!!!!!!!
 

Czar

Lifer
Oct 9, 1999
28,510
0
0
you and your perl crap;) if I had any idea what this does then I'd probably tell you how to do this in php
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
it basically says "If the string ends in 'P' or 'L'..."

What's annoying is that it works on one machine and not another....
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
yes, it's case sensitive. I already checked to make sure $_ wasn't blank. It's showing the correct string.
 

FeathersMcGraw

Diamond Member
Oct 17, 2001
4,041
1
0
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.