my @data; my $count = 0; while () { /^=+$/ and $count++, next; push @{$data[$count]}, $_; }