in reply to Re^2: foreach(@input_lines) giving array ref not scalar? Confusion
in thread foreach(@input_lines) giving array ref not scalar? Confusion

but probably a premature and ill considered 'optimization'

If the size of the dataset is sufficient to make re-using the original array worthwhile, then you could just the subarray back over the string from which it was derived:

$_ = [ $name, $rrate, $wrate, $total ];

That would allow the space used for the original strings to be reclaimed and reused.

Given that source of the data is only 2MB, that probably isn't a worthwhile consideration though.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^3: foreach(@input_lines) giving array ref not scalar? Confusion
  • Download Code