# adapted from the Excel::Writer::XLSX synopsis use 5.010; use warnings; use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( 'perl.xlsx' ); # Add a worksheet $worksheet = $workbook->add_worksheet(); # some data for my $row (0..5) { for my $col (0..2) { $worksheet->write( $row, $col, $row ); } } # internal method used in ->close() $workbook->_store_workbook(); $workbook->close(); { # defer garbage collection to test file local $| = 1; say 'Pausing, press any key to continue'; my $pause = <>; }