#!/usr/bin/perl use strict; use warnings; use Hasher; my $states = Hasher->new( file => 'states', loop => sub { my $data_ref = shift; my ($value, $key) = split ' ', $data_ref->{record}, 2; $data_ref->{hash}->{ uc $key } = $value; }, post => sub { my $data_ref = shift; print "hashed $data_ref->{count} states\n"; } ); my %state = $states->hash(); map { print "$_ = $state{$_}\n"; } keys %state;