Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: dodgy sub

by dragonchild (Archbishop)
on Feb 27, 2002 at 14:55 UTC ( #147910=note: print w/replies, xml ) Need Help??


in reply to dodgy sub

Just so you're aware, you can do something like
$string = str_replace(qr/(?:Hello)|(?:Hi)/, "Good-bye", "Hello My Name + is Elfyn");
qr creates something that allows you to embed regex operators within a string to be used in a regex. :-)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Replies are listed 'Best First'.
Re: Re: dodgy sub
by emcb (Beadle) on Feb 27, 2002 at 15:45 UTC

    Thanks oh worthy monks.

    Im still learning regexps, and i thought my code was wrong. Oh it is :)

    Elfyn

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-12-04 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (58 votes). Check out past polls.

    Notices?