- or download this
my @claim_records = ();
while (<CLAIMS>) {
push(@claim_records, read_record($_));
}
- or download this
## Put this at the top of your program
## This would be much longer in your program.
...
claim_number
claim_type
);
- or download this
sub read_record {
my ($line) = @_;
...
@claim_record{ CLAIM_KEYS } = unpack(CLAIM_TEMPLATE, $line);
return \%claim_record;
}
- or download this
my $sort_by = 'claim_type';
foreach $record ( sort sub { $a->{$sort_by} cmp $b->{$sort_by} } @clai
+m_records ) {
print STDOUT $record->{'claim_number'}, "\n";
}