in reply to Creating the right type of array...
That'll get you a hash, keyed by HRD, BGN, OTI or what have you. To get at all of the third items of HDR, your code is something like this:my %elements; foreach (@lines) { my ($key, @items); chomp; ($key, @items) = split(/,/, $_); push @{ $elements{$key} }, [ @items ]; }
This *is* untested, but even if it's buggy, it'll be remarkably similar to the actual tested code. (I have a bit of a headache right now, and you should really see perlref and perldsc for the real scoop.) No warranty today.foreach my $row (@{ $elements{HRD} }) { print $row->[2], "\n"; # remember, offset by one }
|
|---|