in reply to I need to regex multiple lines
Assuming that input starts with some uppercase key and that your keys are uppercase strings I would suggest following:
my $key; while(<>) { if(s/^([A-Z]+)://) { $key = $1 } push @{$hash{$key}}, $_ } # use array consisting 'LENGTH' print @{$hash{'LENGTH'}}
|
|---|