develooper Front page | perl.perl5.porters | Postings from September 2003

Re: optimizing /\s*,\s*/

Thread Previous
From:
H.Merijn Brand
Date:
September 8, 2003 11:13
Subject:
Re: optimizing /\s*,\s*/
Message ID:
20030908201116.AD7D.H.M.BRAND@hccnet.nl
On Mon 08 Sep 2003 20:06, Dan Sugalski <dan@sidhe.org> wrote:
> On Mon, 8 Sep 2003, H.Merijn Brand wrote:
> 
> > On Mon 08 Sep 2003 19:36, "Jeff 'japhy' Pinyan" <japhy@perlmonk.org> wrote:
> > > A lot of times, when people want to split a string into comma-separated
> > > fields, they use something like
> > > 
> > >   @fields = split /\s*,\s*/, $string;
> > 
> > Yes, I do a lot of split m/\s*\|\s*/, $_, -1
> > What's naive? It's probably an 'Ahh, sure. Darn I forgot.' but enlighten me.
> 
> Probably the issue of commas (or other delimiters) inside quoted strings. 
> That's the one that bites most people.

Ahh, OK, that ain't the case. I generate the data myself from a database with
DBI. When I need CSV, I use CSV_XS :) [ a lot ]

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0, & 5.9.x, and 806 on  HP-UX 10.20 & 11.00, 11i,
   AIX 4.3, SuSE 8.2, and Win2k.           http://www.cmve.net/~merijn/
http://archives.develooper.com/daily-build@perl.org/   perl-qa@perl.org
send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org



Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About