#!/usr/bin/perl

use AnyDBM_File;  
dbmopen(%states, "statedb", 0666[a]) || die;
TRY:  {
     print "State Abbreviation:";
     chomp($abbrev=<STDIN>);
     $abbrev = uc $abbrev;  
     print "Name of the state:";
     chomp($state=<STDIN>);
     lc $state;
     $states{$abbrev}="\u$state"; 
     print "Another entry? ";
     $answer = <STDIN>;
     redo TRY  if $answer =~ /Y|y/;
}
dbmclose(%states);
