use strict; use XML::Twig; warn XML::Twig->VERSION; my $twig = XML::Twig->new(); $twig->parse(<<'XML'); XML my $res = eval { $twig->first_child('address')->first_child('city')->text; }; print "Got " . $res; __END__ 3.48 at tmp.pl line 4. Use of uninitialized value $res in concatenation (.) or string at tmp.pl line 16. Got