Brian Sherwood wrote:
[SNIP]
> Someone also recommended instantiating the object in the perl code and 
> passing it in the vars hash when I call the template toolkit.  This is a 
> good idea, but I don't know how many Net::IP objects I will need before 
> the template is called.

I don't know the ins and outs of Net::IP, but what about something along the 
lines of:
my $vars = {get_net_ip => sub{return new Net::IP(@_);} }
$tt->process( $template, $vars ) || die $tt->error(), "\n";

then call like so [% c1 = get_net_ip() %]

-- Josh

_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to