You can use the map function for this:
@hash_list = ( {foo=>1}, {foo=>2} ); @list = map($_->{foo}, @hash_list);
map applies the function in the first argument over the entire element of the second argument.
grep also cool filters the items in the list and works the same way.
Peter Tillemans
source share