laziness, impatience, and hubris | |
PerlMonks |
Not able to create worksheets inside a subroutineby devbond (Novice) |
on Sep 29, 2013 at 14:57 UTC ( [id://1056226]=perlquestion: print w/replies, xml ) | Need Help?? |
devbond has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl
use warnings; use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; sub create_excel {$workbook = Spreadsheet::WriteExcel>new('FAISTATS_'."$Month".'.xls'); for ( $i=1;$i<=8;$i++) { $s$i = $workbook->add_worksheet( "rpzea0".$i."a001" ) ; } }&create_excel(); I want to create 8 different worksheets inside the excel sheet FAI_STATS_$Month.xls .I am able to do it when the code is not inside a subroutine but when i place the code inside a subroutine and call it ..it only creates one worksheet that too with the name of the FILe. Please help
Back to
Seekers of Perl Wisdom
|
|