in reply to Optimizing Splitting of Array
Since @rows is empty when you assign to it, no need to push onto it. You could write:
as well.my @rows = ($name, $tel, $col3, $col4, $col5, $col6, join " ", @notes) +;
But looking at the code, all it archieves is collapsing multiple whitespace into a single space. I'd write it as:
which should do the same. No splitting and joining needed.while (<DATA>) { s/\s+$//; s/\s+/ /g; print $_, "\n"; }
|
|---|