There is a module Text::CSV_XS that handles (surprise!) CSV files, which
understands quoted strings with commas. I can make it work, so it must be
easy
-----Original Message-----
From: Mike Miller [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 02:47
To: [EMAIL PROTECTED]
Subject: Splitting string using split()
Gurus:
I have a string like this:
$s = '[EMAIL PROTECTED], "Blow, Joe" <[EMAIL PROTECTED]>,Joe Blow
<[EMAIL PROTECTED]>'
And I want to be able to split it up. Using split, like this:
my @addresses = split(/, ?/, $s);
But obviously this causes a problem because of the comma inside the
quotes. I want three parts, and it splits it into four. Is there
some module or nice way to have the commas inside quotes ignored?
Reply to [EMAIL PROTECTED] if possible as I'm only getting
the daily digest of this list.
Thanks,
-Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]