[Templates] Templates : Pass perl variables to BLOCKS
Madan kumar nath
madank at noida.interrasystems.com
Thu Oct 11 22:01:00 BST 2007
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',\@arr);
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
More information about the templates
mailing list