Skip to content

Instantly share code, notes, and snippets.

@gfldex
Created July 23, 2012 12:21
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 gfldex/3163332 to your computer and use it in GitHub Desktop.
Save gfldex/3163332 to your computer and use it in GitHub Desktop.
multi a(&callback:(:$before, *@params)) {
say &callback(1,2,3), 'before';
}
multi a(&callback:(:$after, *@params)) {
say 'after', &callback(4,5,6);
}
my $cb1 = sub(:$after, *@params) {
return @params.join('-');
}
my $cb2 = sub(:$before, *@params) {
return @params.join('+');
}
a($cb1);
a($cb2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment