-
-
Save tene/852550 to your computer and use it in GitHub Desktop.
demo of devel declare prototype
This file contains hidden or 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
use fn; | |
use 5.010; | |
fn foo ($f, $a; $extra) { | |
say "going to call with ($a)"; | |
$f->($a); | |
if (defined($extra)) { | |
say "got extra: $extra"; | |
} | |
say "done with call"; | |
} | |
foo( fn ($msg) { | |
say "bar: $msg"; | |
}, "lol"); |
This file contains hidden or 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
[sweeks@sweeks-laptop dd]$ perl f.pl | |
going to call with (lol) | |
bar: lol | |
done with call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment