Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: replacing pipe "|"

by SarahM (Monk)
on Mar 26, 2003 at 20:38 UTC ( [id://246071]=note: print w/replies, xml ) Need Help??


in reply to replacing pipe "|"

That's because the | is a special character, and you need to escape it. change $rem ="|"; to $rem ="\\|"; and it'll work. Another (cleaner/easier) option is to use \Q and \E (they escape the characters for you). So change s/$rem/$rep/go; to s/\Q$rem\E/$rep/go;

Replies are listed 'Best First'.
Re: Re: replacing pipe "|"
by nadadogg (Acolyte) on Mar 26, 2003 at 21:25 UTC
    Thank you very much guys, and gals, SarahM's answer worked perfectly the first time through, and now maybe ill meet my deadlines :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found