use strict; use warnings; my @array1=(1 .. 20); my @array2=('a' .. 'e' ); my $max_array_length=(scalar(@array1) > scalar(@array2)) ? scalar(@arr +ay1) : scalar(@array2); for(my $index=0; $index<$max_array_length; $index++) { print $array1[$index] if $array1[$index]; print ","; print $array2[$index] if $array2[$index]; print "\n"; }
In reply to Re: printing unequal sized lists side by side
by nvivek
in thread printing unequal sized lists side by side
by nad04299
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |