Since you're in a PERL block anyway, I believe it's better and cleaner
to just call $context->process instead of inserting TT code, i.e.:
print $context->process('test', { funArg => [EMAIL PROTECTED] });
Not sure if it helps thought, but it should. ;-)
-M.
On Tue, 2007-10-16 at 22:27 +0630, Madan kumar nath wrote:
> Hi All,
> Is there a way to pass perl variables to BLOCKS's ?. The
> following code gives "Null Argument passed to function" and
> the value, which I am trying to get from $context is also
> coming NULL.
>
> [% PERL %]
>
> my @arr = ("hello", "madan", "kumar");
> $context->stash->set('funArgValue',[EMAIL PROTECTED]);
> my $yy = $stash->get('funArgValue');
> my @yy = @$yy;
> print "\nValue in main : @yy\n";
>
> [%# Function Call %]
> [% PROCESS test funArg=funArgValue %]
>
> [% END %]
>
> [% BLOCK test %]
> [% IF (! funArg)%]
> print "Null Argument passed to function";
> [% END %]
>
> [% PERL %]
> my $yyy = $context->stash->get('funArgValue');
> print "\nValue in function: $yyy\n";
> [% END %]
>
> [% END %]
>
> Thanx in Advance
> Madan Kumar Nath
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://lists.template-toolkit.org/mailman/listinfo/templates
>
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates