in reply to Parsing XML???
Of course I had to come up with an XML::Twig version!
Oh, and yes, you can use it even if it is not installed by the admin of the machine, see Using Modules in a local directory, or have a look at the FAQ under "module" (perldoc -q module):
#!/usr/bin/perl -w use strict; use XML::Twig; my $t= XML::Twig->new( twig_roots => { element => sub { my %info; $info{last_tra +de_price} = $_->field( 'LastTradePrice'); $info{net_chan +ge} = $_->field( 'NetChange' ); $info{last_tra +de_date} = $_->field( 'LastTradeDate' ); print join( ' +- ', %info), "\n"; # or do something useful }, } )->parse( $xml);
|
|---|