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