Created
November 1, 2017 21:31
-
-
Save jberger/863277a158ae573a09deaf76f8bfadd7 to your computer and use it in GitHub Desktop.
Trailing callback helper
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
sub cb { (ref $_[-1] || '') eq 'CODE' ? pop : undef } | |
sub my_method { my $cb = &cb; my ($self, @args) = @_; ... } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment