Created
December 16, 2008 05:22
-
-
Save tokuhirom/36288 to your computer and use it in GitHub Desktop.
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 strict; | |
use warnings; | |
package mt; | |
use Module::Compile -base; | |
use Text::MicroTemplate qw/render_mt/; | |
sub pmc_compile { | |
my ($class, $source, $extra) = @_; | |
my @vars = do { | |
( my $vars = $extra->{use} ) =~ s/^\s*use\s+mt\s*//; | |
eval "$vars"; | |
}; | |
render_mt($source, @vars)->as_string(); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment