well, all of this started when i decided to use a new module to generate some XML. i put XML::Mini::Document and it began to mess around with everything lol.
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/IPAd
+dress'); # find all IP's
#foreach instance of '/AutomationInformation/NodeList/Node/IPAddre
+ss', 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;
}
this recieves an xml file and looks for every occurance of a tag and then places the content into an array.
|