http://www.perlmonks.org?node_id=47236

aaAzhyd has asked for the wisdom of the Perl Monks concerning the following question: (files)

I have a file such as:

--
blah blah blah
blah blahblahblalh

oh yeah interesteing

no no no
nonnono

yes yes
--

I am wanting to read the file into an array spliting each element
by a blank line, such as @array[0] would be:

blah blah blah
blah blahblahblalh

Here is what I have tried doing:

open (LOG,"Messages.log"); while (<LOG>){ $string .= $_; } @array = split(/^\s*$/, $string);
and i have tried messing around with the regular expresion with no luck ..

Originally posted as a Categorized Question.