in reply to Import comma delimited file into an array
If you aren't concerned with safety -- then just use split on a single comma -- you can even ignore whitespace:
You'll end up with a new line in the last element of your array, but that can be chomped off.my @line = split( '\s*,\s*', $line );
However, i strongly recommend using Text::CSV for this task (or Text::CSV_XS).
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Import comma delimited file into an array
by drodinthe559 (Monk) on Nov 18, 2008 at 18:52 UTC | |
by gone2015 (Deacon) on Nov 18, 2008 at 19:00 UTC |