Thursday, January 18, 2007

Template::Plugin::FillInFormの使い方

--temp.html--



[% USE FillInForm %]

[% FILTER fillinform fdat => fdat1 %]

<form action="http://www.blogger.com/aaa" method="post">

<input type="text" name="hoge">

</form>

[% END %]



--- perl ----

#!/usr/local/bin/perl



use strict;

use Template;



my %values = (

hoge => 'hoge1',

);



my $output;

my $template = Template->new({

OUTPUT => \$output,

TRIM =>1,

});





$template->process(

'temp.html',

{ fdat1 =>\%values,

},

) or print $template->error;



print $output;







--- 実行結果







 

No comments: