On Monday 25 October 2004 16:27, E.Horn wrote:
> Hey!
> How can i pars this xmlfile?
> i just want to have the <MenueName>geo</MenueName> and the count  out of
> this...
>
[..]

Hi,

I can highly recommend XML::Simple - just use it like this:

#!/usr/bin/perl -w

use strict;
use XML::Simple; 
use Data::Dumper;

my $ref = XMLin('xmlin.xml');

# now you've got the whole XML file in $ref:
print Dumper($ref);
print "\n";

print $ref->{'ResultItem'}->[0]{'MenuName'};
print "\t";
print $ref->{'ResultItem'}->[0]{'Count'} . "\n";

__END__

Now you can walk over the hash/array structure and everything's fine :-)

HTH,

Philipp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to