in reply to Why is that a hash slice operand to grep adds keys to the hash (if the slice is bigger than the orig set of keys) ?

You can get the keys w/o the autovivification like this:
@my_filtered_keys = grep {exists $x{$_} && $x{$_} =~ /Yeah hoo!/} 1..1 +0;
or the values w/o autovivification with map:
@my_filtered_vals = map {exists $x{$_} && $x{$_} =~ /Yeah hoo!/ ? $x{$ +_} : ()} 1..10;
Here is an example:
#!/usr/bin/perl -wT use strict; my %x = ( 5 => 'a', 6 => 'b', 7 => 'Yeah hoo!', 8 => 'd', 9 => 'I said, Yeah hoo!', 10 => 'f' ); print "K:$_\n" for grep {exists $x{$_} && $x{$_} =~ /Yeah hoo!/} 1..10 +; print "V:$_\n" for map {exists $x{$_} && $x{$_} =~ /Yeah hoo!/ ? $x{$_ +} : ()} 1..10; print "X:$_\n" for keys %x; __END__ =head1 OUTPUT K:7 K:9 V:Yeah hoo! V:I said, Yeah hoo! X:7 X:8 X:9 X:10 X:5 X:6
For more on autovivification see: Autovivification : What Is It and Why Do I Care? by by Uri Guttman.

-Blake