Python: def print2D(table) : # print LoL print('\n'.join([' '.join([str(score) for score in row]) for row in table])) Perl: sub print2D { my $table_ref = shift; foreach my $row_ref (@$table_ref) { print "@$row_ref\n"; } }