in reply to Use of uninitialized value $_ in pattern match (m//)

XML::Simple changed the data structure

With an xml parser like XML::Twig you can build any data structure you want

#!/usr/bin/env perl use strict; use warnings; use XML::Twig; my $t = XML::Twig->new( twig_handlers => { 'ip4-network' => \&network, }, pretty_print => 'indented', ); my $xml = do{local $/;<DATA>}; $t->parse($xml); sub network { my ($t,$e) = @_; my $range = $e->first_child('dhcp-range'); if ( defined $range ){ # do stuff print $range->att('range')."\n"; }; }
poj