in reply to Proper way to split a line with the "," delimiter
as ++Eily said while I was typing this up: unless you throw away the 'nick' element somehow, it's 6 elements. I tried on an ancient linux perl and on a recent windows strawberry perl, and both gave the counts (6) I would expect:
perl -le 'print $]; @a = split/,/,"nick,1,2,,56,88"; print scalar @a' +; perl -V:osname 5.008005 6 osname='linux';
and
perl -le "print $]; @a=split/,/,'nick,1,2,,56,88'; print scalar @a" & +perl -V:osname 5.026002 6 osname='MSWin32';
edit: and I also meant to say, the proper way to parse CSV is with Text::CSV
|
|---|