in reply to parsing CSV file with embedded commas (fortunately, fixed-width) - is unpack the solution?

You could use unpack similar to the following (as long as the fields are fixed width) :
my $data = qq!'a','b, and c','d '!; my ($a,undef,$b,undef,$c) = unpack("a3a1a10a1a3",$data);

If the fields are not fixed width, unpack may not be the bext way to go.
i had a memory leak once, and it ruined my favorite shirt.
  • Comment on Re: parsing CSV file with embedded commas (fortunately, fixed-width) - is unpack the solution?
  • Download Code