for(keys %Hash1) { print "$_\n" if exists $Hash2{$_}; }