Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Problem with split using a | seperator

by ikegami (Patriarch)
on Jan 23, 2009 at 16:30 UTC ( [id://738518]=note: print w/replies, xml ) Need Help??


in reply to Problem with split using a | seperator

split's argument is a regexp pattern. "|" is special in regexp patterns.
split(/\|/, $record );

Wouldn't hurt to use Text::CSV_XS...

Replies are listed 'Best First'.
Re^2: Problem with split using a | seperator
by Grey Fox (Chaplain) on Jan 23, 2009 at 16:48 UTC
    Thanks;

    It's good to know that the split argument is a regex pattern. I changed it and it works great.

    -- Grey Fox
    "We are grey. We stand between the darkness and the light" B5
      There's also quotemeta, as in: split quotemeta '|', $record;

Log In?
Username:
Password:

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

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

    No recent polls found