
| Contents |
|||||||||||||||
| [an error occurred while processing this directive] |
5.5 SlicesIt turns out you can slice hashes just like you were able to slice arrays. This can be useful if you need to extract a certain set of values out of a hash into a list.
use strict; my %table = qw/schmoe joe smith john simpson bart/; my @friends = @table{'schmoe', 'smith'}; # @friends has qw/joe john/
Note the use of the |