in reply to Re^2: slicing array based on values but not index
in thread slicing array based on values but not index

map { push @{$res{$_->[2]}}, $_ } @arr;
map loops thro' all values of the array @arr - setting $_ to each value (an array ref.) in turn - pushing that value onto an array in a hash keyed on the last element of each individual array.

As you can see, the result you're interested in is the array of values of the newly created hash.

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^4: slicing array based on values but not index
by suggestsome (Initiate) on Aug 13, 2009 at 22:32 UTC
    @ Bloodnok:

    Thank you very much, :).

      It can also be written as:

      push @{ $res{$_->[2]} }, $_ for @arr;

      Some people are finicky about map in void context.

        TFT ikegami ,

        I keep forgetting the for idiom you suggest - I really should remember to use map when and only when, modifying (elements of) the input list...

        A user level that continues to overstate my experience :-))