use strict; use warnings; open FILE, $my_file or die "Can't open $my_file\n"; my %hash; while () { my ($name, $code) = split(/\t/); } #### # Still untested if ( !defined( $hash{$name} ) ) { $hash{$name} = $code; } #### # Still untested if ( !defined( $hash{$name} ) or $code < $hash{$name} ) { $hash{$name} = $code; }