Perl version: v5.10.1 (*) built for x86_64-linux-thread-multi
I am using Spreadsheet::WriteExcel and I have been able to successfully create a new workbook, create worksheets, close workbook, etc. However, after issuing close on the workbook, I can no longer print to STDOUT.
my $outFile = tmpnam();
my $workbook = Spreadsheet::WriteExcel->new($outFile);
die "Error creating new Excel workbook: $!" unless defined $workbook;
...
$workbook = close() or die "Error closing Excel workbook: $!";
print "Trying to print something\n";
This is when I get the “print() on closed filehandle STDOUT” error message.
I’ve read and tried to use IO::Scalar method described by John McNamara to no avail. How do I re-open STDOUT for output?
This calls the global function
closewith no parameter, thereby closingSTDOUT(or whatever the last selected filehandle was).Did you mean this?