[Templates] Templates : Pass perl variables to BLOCKS

Madan kumar nath madank@noida.interrasystems.com
Wed, 19 Sep 2007 22:07:08 +0630


Hello ,
  
	Is there a way to pass an Perl variable to BLOCK's ?. 
I want to declare a handle to excel sheet and then pass it to
some function (BLOCK), to write more stuff to sheet. 

[% PERL %]
        use Spreadsheet::WriteExcel;
        my $workbook = Spreadsheet::WriteExcel->new("example.xls");
        my $sheet1 = $workbook->add_worksheet("example");
        $sheet1->write ('A1',"Testing address");
        [% PROCESS test sheet=$sheet1 %] [%# *** function Call ***%]
[% END %]

[% BLOCK test %]
    [% PERL %]
    $sheet->write('A2',"Hello");
    [% END %]
[% END %]


Thanx in Advance for Help
Madan


--Madan Kumar Nath