open my $fh, '>', \my $str or die "Failed to open filehandle: $!"; my $workbook = Excel::Writer::XLSX->new( $fh );