my @results = foreach (@data) { $_ = $_ * 13; # some command to add the element to the resulting list # kind of push(), but how to get the reference # to the resulting array? } #### @results = eval { my @r; foreach (@data) { $_ = $_ * 13; push(@r); } return(@r); }