in reply to Re^2: Excel::Writer::XLSX 0 byte outfile
in thread Excel::Writer::XLSX 0 byte outfile

It seems that something goes wrong when you create your format in $text_format and you then pass an unblessed hash along to the ->write call. I don't see anything in the code of Excel::Writer::XLSX why that should happen, but maybe you find something. Maybe debugging this with Data::Dumper to see what you get in $text_format could help.