Skip to content

Instantly share code, notes, and snippets.

@AlexDenisov
Created January 23, 2013 08:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDenisov/4603229 to your computer and use it in GitHub Desktop.
Save AlexDenisov/4603229 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment