use warnings; use strict; use XML::Simple; my $str = ' 10.0.0.101 10.0.1.101 10.0.0.102 10.0.0.103 10.0.1.103 10.0.0.111 10.0.1.111 10.0.0.112 10.0.0.113 10.0.1.113 10.0.0.121 10.0.1.121 10.0.0.122 10.0.0.123 10.0.1.123 '; my $xml = XMLin($str); print "$_\n" for @{ $xml->{station17}{ip} }; __END__ 10.0.0.121 10.0.1.121 10.0.0.122 10.0.0.123 10.0.1.123