in reply to Parsing a Tagged File Format

Untested, but I usually get this stuff right... {grin}
my $tag = "Invalid"; my %results; while (<>) { if (/^ER/) { last; } elsif (/^([A-Z]{2})\s+(.*)/) { # might need adjustment $tag = $1; push @{$results{$tag}}, $2; } elsif (/^\s+(.*)/) { # might need adjustment push @{$results{$tag}}, $1; } else { die "I don't understand $_"; } }
and now @{$results{T2}} is qw(Line2 Line3 Line4).

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.