sub whatever { my $self = shift; # ... do stuff to set ar_data... # Slice out the last element of each stored array into a new array my @last_elements; push @last_elements, $_->[$#_] for @{$ar_data}; return \@last_elements; }