1 #!/usr/bin/perl 2 3 my $file = 'addrfile.txt'; 4 5 open I, '<', $file 6 or die "Can't open '$file' for reading: $!\n"; 7 8 chop (%hash = map { split /\s*,\s*/,$_,2 } grep (!/^$/,)); 9 10 # print out that hash 11 12 print "$_ => $hash{$_}\n" for keys %hash;