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.
In reply to Re: Parsing a Tagged File Format
by Aristotle
in thread Parsing a Tagged File Format
by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |