my $format = "%-8s %-5s %-8s\n"; my $output = sprintf $format, qw/Username Level Created/; $output .= sprintf $format, @$_ for @rows;