# Trivial double loop - build, then print my $aref=[]; #reference to anonymous array. foreach $thing (@thingies) { push @{$aref},foo($thing); } print_table($aref); #... sub print_table { my $aryref=shift foreach my $thing (@{$aryref}) { #etc. } }