use strict; use warnings; use XML::XPath; use CGI::Pretty qw(:standard); my $xpath = XML::XPath->new(ioref => *DATA); my $nodeset = $xpath->find('/profile/bids/itemcode'); my @b_item = map $_->string_value, $nodeset->get_nodelist; print header, start_html('itemcodes'), h1('Then'), (map { $_,br } @b_item), end_html, ; __DATA__ 4985874875 7685976785 6758679837 7849609576 2857689576 6758767856 3758678576