in reply to Tidier and more efficient parsing code

Try this solution if it works for you :)
my $data = []; my $section = 0; while (<TEXT>) { if (/^section(\d)/) { $section = $1; } else { next unless $section; push (@{$data->[($section - 1)]}, $_); } } #my @section_one = @{$data->[0]}; # if absolutely #my @section_two = @{$data->[1]}; # neccessary only

Sure, there are easier ways to do this, but I thought it was quite easy to read like this..
-octo-