in reply to Callbacks and templates.
#!/usr/bin/perl + use strict; use warnings; use Template; + my $tt = Template->new; + my $data = { word => 'callbacks', emphasise => \&emphasise }; + $tt->process(\*DATA, $data) || die $tt->error(), "\n"; + sub emphasise { return "** @_ **"; } + __DATA__ This is a template. It includes [% emphasise(word) %]
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
---|
Replies are listed 'Best First'. | |
---|---|
Re(2): Callbacks and templates.
by bart (Canon) on Apr 13, 2004 at 09:13 UTC | |
Re: Re: Callbacks and templates.
by LukeyBoy (Friar) on Apr 13, 2004 at 07:17 UTC |