Skip to content

Instantly share code, notes, and snippets.

@dginev
Created May 24, 2015 17:51
Show Gist options
  • Save dginev/eabb2c664a9816198b66 to your computer and use it in GitHub Desktop.
Save dginev/eabb2c664a9816198b66 to your computer and use it in GitHub Desktop.
logIndex in Perl
#!/usr/bin/env perl
my @logIndex;
for my $i(0..10) {
my $l = sub {print "$i\n"};
push @logIndex, $l;
}
foreach my $l(@logIndex) {
$l->();
}
# Prints 0 to 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment