in reply to Re^2: Matching regular expression over multiple lines
in thread Matching regular expression over multiple lines
while ( <FILE> ) { $data .= $_; }
That'll work, but it's not particularly efficient because it chops the file up line by line and then puts it back together. You could use the same "slurp" idiom I showed (do { local $/; <$fh> }), which will read the entire file in one go, which is more efficient.
an alternative to using a regex [quoted from here]
I just wrote about this in general here: Parsing HTML/XML with Regular Expressions
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Matching regular expression over multiple lines
by Maire (Scribe) on Oct 16, 2017 at 14:26 UTC |