c-em5q
Last Updated: February 25, 2016
·
430
· alexdenisov
6dc2fd642323cb9bab9a050710290353

Iterate few lists with Perl

use List::MoreUtils qw( each_array );

my @first = qw( foo bar buzz );
my @second = (1, 2, 3);

my $it = each_array( @first, @second );
while ( my ($f, $s) = $it->() ) {
  print "$f = $s\n";
}

# Output
# foo = 1
# bar = 2
# buzz = 3  

https://gist.github.com/4603229

Say Thanks
Respond