in reply to Work Sheets in excel in Perl

The problems is that your worksheet objects have a different scope to the parent workbook object and as a result they get garbage collected too early.

The solution is to place the worksheet reference in the same scope as the workbook or else to call the the workbook close() method to ensure that the destructors are called in the right order:

foreach my $file (@files) { if ( !( ( $file eq "." ) || ( $file eq ".." ) ) ) { ... } } $workBook->close();
See the close() section of the Spreadsheet::WriteExcel docs for more information.

--
John.

Replies are listed 'Best First'.
Re^2: Work Sheets in excel in Perl
by anand_perl (Novice) on Sep 29, 2008 at 09:45 UTC

    Thanks a lot John!!!!

    It works!!!