Rob Anderson wrote at Mon, 09 Jun 2003 16:08:54 +0100:

> I have the following code, which I intend to use to save/restore an array
> to/from a text file with.
> 
> As I'm using a comma to delilmit the data I'm escaping commas on the way
> out, an unescaping on the way in. This means that when I split the string
> into an array, I need to make sure I DON'T split on escaped commas, hence
> the /[^\\],/ regex in my split. But my problem is that this split strips the
> last character off all but the last element in the array.
> 
> Is there some way to exclude the [^\\] part from being matched, err or
> something, help.
> 
> My code...
> [...]

That's already invented.
The CPAN modules
Text::CSV
Text::CSV_XS
can solve your problems
(and take also care for commas in quotes)


Greetings,
Janek

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to