Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

RE: RE: REGEX: muliple search and replace

by floopy (Sexton)
on Nov 15, 2000 at 02:26 UTC ( [id://41658]=note: print w/replies, xml ) Need Help??


in reply to RE: REGEX: muliple search and replace
in thread REGEX: muliple search and replace

I'm not necessarily suggesting you do this, but if your variables are, say, $name, $email, etc. (i.e. they aren't in hashes) you can use symbolic references:
s/<!--var (\w+)-->/${"main::$1"}/eg
(so <!--var foo--> would be replaced by the contents of $foo.)

The only real advantage to punk music is that nobody can whistle it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://41658]
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-18 03:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found