in reply to Extracting data from a 2D array

Yet another way to do it is:
push @lastnames, map { $_->[1] } map { [ split "," ] } while (<FH>);
I'm assuming that with "scalar variable storing data" you mean a filehandle.

ar0n ]