Skip to content

Instantly share code, notes, and snippets.

@barefootcoder
Created December 4, 2012 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barefootcoder/4208557 to your computer and use it in GitHub Desktop.
Save barefootcoder/4208557 to your computer and use it in GitHub Desktop.
Example of alias parameters as requested by Gabor in Perl Weekly
#! /usr/bin/env perl
use Modern::Perl;
use Method::Signatures;
func foo(\@bar, \@baz)
{
return map { $bar[$_] + $baz[$_] } 0..$#bar;
}
my @x = (2, 5, 8, 1);
my @y = (7, 3, 1, 6);
say join(', ', foo(\@x, \@y)); # 9, 8, 9, 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment