use warnings; use strict; use XML::Twig; my $xml = < 92190602 12345678 USJJT XML my $twig = XML::Twig->new( twig_handlers => { CorpActnEvtId => sub { print $_->text(), "\n" } } ); $twig->parse($xml); __END__ 12345678