[...] use Data::Dumper; my $parser = XML::Twig->new(twig_handlers => { 'DeinTag' => sub{_tag($self,@_)}, }); sub _tag{ my ($self,$t,$tag) = @_; print Dumper $tag->{att}; }