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
In reply to Re^3: Matching regular expression over multiple lines
by haukex
in thread Matching regular expression over multiple lines
by Maire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |