|
The module's documentation for the new() method calls what you want to do "writing a file to a scalar" and shows the following example:
# Requires perl 5.8 or later
open my $fh, '>', \my $str or die "Failed to open filehandle: $!";
my $workbook = Spreadsheet::WriteExcel->new($fh);
my $worksheet = $workbook->add_worksheet();
$worksheet->write(0, 0, "Hi Excel!");
$workbook->close();
# The Excel file in now in $str. Remember to binmode() the output
# filehandle before printing it.
binmode STDOUT;
print $str;
|