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:

my @line = split( '\s*,\s*', $line );
You'll end up with a new line in the last element of your array, but that can be chomped off.

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
    Now, if I import more than one row, don't I need to bind it?

      For that you need to consider an array of arrays, see perldsc.