while(){ chomp(); m/([A-Z]) -> (.*)/; # take the line, put the righthand side # into $1, put lefthand side into $2 $GRAMMAR{$1} = $2; # enter into hash table GRAMMAR } print "gonna print some info: \n"; while(($k, $v) = each %GRAMMAR) { print "$k\n"; }