Skip to content

Instantly share code, notes, and snippets.

@Tux
Created March 8, 2015 13:37
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 Tux/86f2b3cab516be190631 to your computer and use it in GitHub Desktop.
Save Tux/86f2b3cab516be190631 to your computer and use it in GitHub Desktop.
use v6;
my %cb;
sub foo {
my @f = (1, 2);
defined %cb{"cb"} and %cb{"cb"}.(1, @f);
return @f;
}
foo().perl.say;
%cb{"cb"} = sub { }; # NO ACTION AT ALL
foo().perl.say;
=>
Array.new(1, 2)
Too many positionals passed; expected 0 arguments but got 2
in sub at t.pl:14
in sub foo at t.pl:9
in block <unit> at t.pl:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment