Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: "Dynamically" Accessing a HoH

by dave0 (Friar)
on Jun 02, 2005 at 16:26 UTC ( [id://462961]=note: print w/replies, xml ) Need Help??


in reply to Re: "Dynamically" Accessing a HoH
in thread "Dynamically" Accessing a HoH

Given that the input data was originally XML parsed with XML::Simple, if you're going to use a format like depTar/name for the user input, you can use XML::XPath to extract the results:
use XML::XPath; use XML::XPath::XMLParser; my $usr_string = "depTar/name"; my $xml = "<depTar><name>c_p20</name><loc>srvr1</loc></depTar>"; my $xp = XML::XPath->new(xml => $xml); my $nodeset = $xp->find($usr_string); foreach my $node ($nodeset->get_nodelist) { print $node->string_value(), "\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2025-06-21 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.