Using values function to get all value in a hash
#!/usr/bin/perl -w use strict; my %where = ( A => "AA", B => "BB", C => "CC", D => "DD" ); foreach (values %where) { print "someone lives in $_\n"; }