my @accounts = [ [ current => 1000 ], [ savings => 2000 ], [ other => 500 ], ]; display_2d(\@accounts); # Should display: current | 1000 savings | 2000 other | 500 #### my $width_col = 8; say join ' | ', map { # Give each column the same size length($_) >= $width_col ? $_ : $_ . " "x($width_col-length($_)) # add spaces } @$_ for @rows;