Created
January 9, 2012 23:46
-
-
Save tadzik/1585730 to your computer and use it in GitHub Desktop.
Bug or feature?
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
┌─[tadzik@yavin4]─[~/src/perl/bailador] (master)* | |
└─[%]─> cat lib/Bailador.pm | |
module Bailador; | |
our sub our_template { | |
return "(our template)" | |
} | |
sub exp_template is export { | |
return "(exp template)" | |
} | |
sub hook is export { | |
&our_template.wrap: { "wrapped {callsame()}" }; | |
&exp_template.wrap: { "wrapped {callsame()}" }; | |
} | |
┌─[tadzik@yavin4]─[~/src/perl/bailador] (master)* | |
└─[%]─> cat examples/app.pl | |
use Bailador; | |
sub foo { | |
say Bailador::our_template(); | |
say exp_template(); | |
} | |
hook(); | |
foo(); | |
┌─[tadzik@yavin4]─[~/src/perl/bailador] (master)* | |
└─[%]─> perl6 examples/app.pl | |
wrapped (our template) | |
(exp template) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment