in reply to Printing an array in columns - improvements?

Here's my attempt at the same problem.

#!/usr/local/bin/perl -w use strict; use POSIX; my @array = qw/one two three four five six seven eight nine ten/; my $cols = 3; my $tabs = 1; foreach my $value ( @array ) { my $foo = ceil( length( $value ) / 8 ); $tabs = $foo if $tabs < $foo; } while ( @array ) { for ( 1 .. $cols ) { my $slice = shift @array; print $slice if defined $slice; print "\t" for 1 .. $tabs; } print "\n"; }

-Ben Jacobs