in reply to newbie hasher

If your lines are simply host and IP separated by a space, then it's pretty simple:
open my $fh, "<input.dat" or die "Couldn't open file: $!"; my %hosts; while (<$fh>) { chomp; my ($host, $ip) = split; $hosts{$host} = $ip; } use Data::Dumper; print Dumper \%hosts;