in reply to Re^2: How to use split() in perl to ignore white space and ','
in thread How to use split() in perl to ignore white space and ','

"...Can't we optimize it using regex memory?"

I'm not sure what you mean but i guess you perhaps mean something like this:

my $string = "hello,'world, yo',matt"; my @result = $string =~ /(\.+),('.+'),(.+)/; print qq($_\n) for @result;

See also Is guessing a good strategy for surviving in the IT business? and perlretut.

But i'm sure that this is not really an optimization. I think, the some solutions given already are probably better.

Edit: I tried to be more precise in judgement...

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»