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

Re: Surprised by split

by dave_the_m (Monsignor)
on Aug 11, 2005 at 10:01 UTC ( [id://482885]=note: print w/replies, xml ) Need Help??


in reply to Surprised by split

You are using a string literal rather than a regular expression literal, so the \ gets removed by the double-quoted string handling code before it gets passed to the regex compiler. Use a regex literal instead:
$ perl -wle 'print join ",", split /\|/, "abc|def"' abc,def $

Dave.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-03-29 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found