>>>>> "Jay" == Jay Lawrence <[EMAIL PROTECTED]> writes:
Jay> I really like the OUTPUT => sub { } config option for templates. The *only*
Jay> thing is I'd like to pass a variable into the calling routine to avoid
Jay> using a package global.
I don't understand why you think the only two choices are "the way it is"
and "package globals". What's wrong with using a lexical in the closure?
my %vars = (fred => 1, barney => 3);
my $tt = Template->new( ... );
...
$tt->process($template, \%vars,
sub { my $o = shift; ... $tt ...; ... $vars{fred} ... ; }
);
Look ma, no package vars. Just lexicals.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!