@c = map { "$a[$_]-$b[$_]" } (0..(($#a > $#b) ? $#a : $#b)); # And a more twisty way... my $iterator; { my $i = 0; $iterator = sub { ($i = 0, return undef) if (@_); return undef if ($i > $#a and $i > $#b); return ("$a[$i]-$b[$i]",$i++)[0]; }; } push @c, $_ while ($_ = $iterator->());
In reply to Re: Combining Arrays
by premchai21
in thread Combining Arrays
by iamcal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |