in reply to Specific Regex with Multilines (/s and /m): Why Doesn't This Work?
Did you undefine the input record separator i.e. "undef $/;". If this is not the case you would be trying to match a multiline regex (i,e, your example chunk has 7 lines), but only reading the file line by line. So obviously the match would fail as you are comparing a single line with a pattern that expects more than one line.
Naturally in that case you have to use //s. Also the while loop has to change so that it loops as long as you find something with the regex, the file itself is read only once
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Specific Regex with Multilines (/s and /m): Why Doesn't This Work?
by onelesd (Pilgrim) on Jul 18, 2011 at 19:55 UTC | |
|
Re^2: Specific Regex with Multilines (/s and /m): Why Doesn't This Work?
by elvenwonder (Initiate) on Jul 19, 2011 at 14:23 UTC | |
by chromatic (Archbishop) on Jul 19, 2011 at 16:18 UTC |