Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Splitting a line on just commas

by reddydn (Initiate)
on Jun 14, 2010 at 17:15 UTC ( [id://844668]=note: print w/replies, xml ) Need Help??


in reply to Re: Splitting a line on just commas
in thread Splitting a line on just commas

@arr = split /(".+?")|,/, $s print @arr a b "hey,you" "str1, str2, str3" end

Replies are listed 'Best First'.
Re^3: Splitting a line on just commas
by ikegami (Patriarch) on Jun 14, 2010 at 17:27 UTC
    That doesn't work. It actually returns
    ( 'a', undef, 'b', undef, '', '"hey, you"', '', undef, '', '"str1, str2, str3"', '', undef, 'end', )

    Keep in mind the first arg of split is a separator.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://844668]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-20 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found