in reply to Parsing a Tagged File Format
my $cur_tag; my %lines_for; while(<>) { chomp; my ($tag, $line) = split /\s+/, $_, 2; $cur_tag = $tag || $cur_tag or die "First input line has no tag"; last if $cur_tag eq 'ER'; push @{$lines_for{$cur_tag}}, $line; }
Makeshifts last the longest.
|
---|