On Fri, Nov 18, 2011 at 01:15:47PM +0100, Manuel Bouyer wrote: > On Fri, Nov 18, 2011 at 07:46:21AM +0200, Alan Barrett wrote: > > Assuming that there's no need to handle fields with embedded spaces, > > perl's split() function will DTRT. > > No, it does not because there are fields that can be empty.
This seems to work fine for me: $ perl -e 'my @x = split(/,/, "a,b,,c"); print "1:$x[0] 2:$x[1] 3:$x[2] 4:$x[3]\n";' 1:a 2:b 3: 4:c eric
