Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: split on delimiter unless escaped

by ikegami (Patriarch)
on Nov 09, 2010 at 22:50 UTC ( [id://870421]=note: print w/replies, xml ) Need Help??


in reply to Re: split on delimiter unless escaped
in thread split on delimiter unless escaped

As you've demonstrated, it fails to split

bacon!!;eggs

Fix

while (<>) { chomp; s/\x{00}/\x{00}0/g; s/!!/\x{00}1/g; s/!;/\x{00}2/g; my @a = split /;/; for (@a) { s/\x{00}2/;/g; s/\x{00}1/!/g; s/\x{00}0/\x{00}/g; } ... }

I also fixed the inability to have char 00 in the data.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-25 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found