in reply to Re^2: Counting Random Elements
in thread Counting Random Elements
You should almost never "read the file into an array". In general for large files that leads to poor performance.
In the particular case of CSV files you should not process them line by line! CSV generally allows line breaks within fields so a row of data may span more than one line. Not a common case I grant you, but the Text::xSV module correctly handles that case along with the more common case of a line is a row.
To solve any programming problem it helps to start with a high level sketch of how things are going to go so even coding up what you have described and using comments to indicate where work needs to be done would be considered as a good starting point.
|
|---|