in reply to Confusing regex match.
An extraneous character was my thought also, with the usual suspect being a newline, the data being read from a file (but in that case, the regex must be modified with /s so that "dot matches all"), or perhaps some kind of "end-of-text" character. Did you do a hex dump of the file yet?
>perl -wMstrict -le "my $s = qq{pl\n}; ;; print 'match sans /s' if $s =~ /p.{2,6}/; print 'match with /s' if $s =~ /p.{2,6}/s; " match with /s
|
|---|