sub genIcpList($){ my @icpList; my $fn = $_[0]; my $xp = XML::XPath->new(filename => $fn); my $ip; #specify what we are looking for... my $nodeset = $xp->find('/AutomationInformation/NodeList/Node/IPAddress'); # find all IP's #foreach instance of '/AutomationInformation/NodeList/Node/IPAddress', add it to the array foreach my $node ($nodeset->get_nodelist) { $ip = substr(XML::XPath::XMLParser::as_string($node), 11, -12); @icpList = (@icpList, $ip); } #return the array to main return @icpList; }