Created
December 4, 2012 20:54
-
-
Save barefootcoder/4208557 to your computer and use it in GitHub Desktop.
Example of alias parameters as requested by Gabor in Perl Weekly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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