What I need to do is be able to read the data based on the SECOND_NUMBER.
Sounds like you want an array of records for each value SECOND_NUMBER can take.
my $header = <>; chomp($header); my @field_names = split /\t/, $header; my %grouped_by_num2; while (<>) { chomp; my %rec; @rec{ @field_names } = split /\t/; push @{ $grouped_by_num2{$rec{SECOND_NUMBER}} }, \%rec; } use Data::Dumper; print(Dumper(\%grouped_by_num2));
In reply to Re: Which data structure should I use?
by ikegami
in thread Which data structure should I use?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |