in reply to Print unless behaving strangely
So it works as I expected (not printing $_ because of the successful match) and not as your reported result. Could it be that there are really two spaces between the colon after PID and the comma, or perhaps a tab and not a space, or some other special character? A starting point for the investigation might be to try this:DB<1> $_ = "PID: , VID: 255, SN: AGM163923J5"; DB<2> print $_ unless /PID: ,/; DB<3>
to see if it matches or not.print $_ unless /PID:\s+,/;
|
|---|