Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Passing regexp as argument

by edan (Curate)
on Dec 20, 2004 at 09:56 UTC ( #416143=note: print w/ replies, xml ) Need Help??


in reply to Passing regexp as argument

Pass string and the replacement as 2 arguments:

$obj->changeName($topNodeOfXmlTree, 'WrongNode', 'RightNode'); sub changeNodeNames { my ($self,$node,$from,$to) = @_; my $nodeName = $node->nodeName; $nodeName =~ s/$from/$to/; ... }
--
edan


Comment on Re: Passing regexp as argument
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-09-18 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (109 votes), past polls