sub write_row { my $worksheet = shift; my $row = shift; my $col = 0; while (my $cell = shift) { if ($cell =~ /"/) { $worksheet->writestring($row, $col++, $cell) } else { $worksheet->write($row, $col++, $cell) } } }