Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 scrutinizing the Monastery: (2)
As of 2015-04-28 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (515 votes), past polls