Skip to content

Instantly share code, notes, and snippets.

@ytnobody
Created August 7, 2012 02:19
Show Gist options
  • Save ytnobody/3280762 to your computer and use it in GitHub Desktop.
Save ytnobody/3280762 to your computer and use it in GitHub Desktop.
map function in pure-perl
sub mymap (&@) {
my ( $code, @list ) = @_;
my @res ;
for my $item ( @list ) {
$_ = $item;
push @res, $code->();
}
return @res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment