in reply to create xlsx

I don't believe that this is what happened. e.g.
use Data::Dumper; my @ar = "fred bert"; print Dumper(\@ar);
produces
$VAR1 = [ 'fred bert' ];
I can't match the summary with your full code either to see where it doesn't DWIM from your perspective. Perhaps you could step through the code using perl -d. Enter the h command to get the list of commands when using the perl debugger. At each step, the x command can be used to examine variables to see whether the last executed statement performed as you expected.

One world, one people