Hello wiser ones,
How would I pass a regexp as a parameter to a subroutine? I would like to do something like:
changeName($topNodeOfXmlTree,'s/WrongNode/RightNode/');and have the function recurse through the XML tree and change, in my case, the node names:
sub changeNodeNames { my ($self,$node,$regEx) = @_; my $nodeName = $node->nodeName; $nodeName =~ $regEx; ...
The above, however, does not work.
Thanks for your help,
In reply to Passing regexp as argument by loris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |