Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: how could i captured selected data of the input ?

by dimar (Curate)
on Nov 09, 2006 at 14:06 UTC ( [id://583107]=note: print w/replies, xml ) Need Help??


in reply to how could i captured selected data of the input ?

In addition to the modules suggested in previous posts, you probably also want to take a look at how you are handling the raw data (assuming it really is XML, and not just a deceptively similar analogue) after you have loaded it. It looks like you are loading a simple table structure, so all you need to do is treat your data like a table in your code. There are modules that will help you do that as well (see e.g., DBD-AnyData). Hence, to directly answer your questions here is a psuedo-code example:
my $oTable = XML::Simple::XMLin($sFile); print $oTable->[1]; ## 1. print second record only print $oTable->[1]{chargeableduration}; ## 2. do that
This is pseudo-code because it ignores the real code needed to fulfill these assumptions: 1) you easily loaded your XML into an AoH; 2) you know the code to print out the second record is actually a bit more involved if you want some useful output; 3) you know the difference between an AoH and an AoA. If these assumptions are beyond your familiarity, have a shot at supersearch and let the learning begin.

=oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-03-28 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found