Example %hash = ("router" => "10.23.0.1", "www" => "10.23.0.2"); foreach $key (keys %hash) { print "$key has IP address $hash{$key}\n"; } prints: www has IP address 10.23.0.2 router has IP address 10.23.0.1