in reply to printing arrays
my @left = ( 1, 2, 3, 4, 5 ); my @mid = qw/ A B C D E /; my @right = qw/ A3 F7 3B 35 EF /; my $high = 0; $high = ( $high > $_ ) ? $high : $_ foreach $#left, $#mid, $#right; foreach my $idx ( 0 .. $high ) { local $, = "\t"; print map { ( exists $_->[$idx] ) ? $_->[$idx] : '' } \@left, \@mid, \@right; }
This has the advantage of not adding useless padding to the end of your arrays. Plus it preserves the array, so you don't have to make a copy of it ahead of time.
Once again it's untested: buyer beware.
Dave
|
|---|