Skip to content

Instantly share code, notes, and snippets.

@softmoth
Created September 7, 2012 06:40
Show Gist options
  • Save softmoth/3663884 to your computer and use it in GitHub Desktop.
Save softmoth/3663884 to your computer and use it in GitHub Desktop.
Pair literal or named parameter in Capture context
sub foo (*@positional, *%named) {
@positional.perl.say;
%named.perl.say;
}
# Result: ('one' => 1, 'two' => 'ii', 'one' => Block).list, ().hash
foo('one' => 1, 'two' => 'ii', 'one' => { say "ॐ" })
# Result: ().list, ('two' => 'ii', 'one' => Block).hash
foo(one => 1, two => 'ii', one => { say "ॐ" })
foo(:one(1), :two<ii>, :one({ say "ॐ" }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment