That is just a part of it, I think the rest isn't important. My objective is to populate the Master array, print it, and make changes to the hlist and then populate the new array with the changes in the hlist. Currently the array prints the info out the first time, but is empty if printed a second time Thanks# Traverse the tree and create a data array of unique elements my $lastline; while($HList->info('exists', $Topology)) { $_ = $HList->info('next', $Topology); $Topology = $_; unless (/^$lastline/) { push (@data, $lastline); } $lastline = $_; } # Seperate the child from the parent (leaf from the tree) my $cnt = 0; foreach $_ (@data) { if ($_ =~ /\//) { $check = $_; ($parent, $child) = $check =~ m/(.*\/)(.*)$/; # Only take the unique parents push (@master, $parent) unless ($seen{$parent}++); $child = join("", $child, "\=[Unique $cnt]"); $cnt ++; push (@master, $child) unless ($seen{$child}++); } } print "MASTER: @master\n";
In reply to Re: Re: Clearing a hash/array
by Anonymous Monk
in thread Clearing a hash/array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |