Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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

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 imbibing at the Monastery: (9)
As of 2016-09-28 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (521 votes). Check out past polls.