In addition to the various ways already mentioned, you could also
undef $/; and then (Camel, 3rd edition, p.666) read the file into a single scalar, replacing new lines with spaces. Then you could parse on strings bounded by pairs of
[].
TMTOWTDI. :)
--t. alex
"Of course, you realize that this means war." -- Bugs Bunny.