Looks to me like you're keying the hash on the wrong data -- I think you'd have an easier time if you keyed your hash on $host and stored an array of $router's for each host.
So your hash assignment would like this:
push @{$hash{$host}}, $router;
And your current foreach loop would then be:
foreach $key (keys %hash) { print "$program $key $matrix "; print "$path/CISCO_$_.clean " for @{$hash{$key}}; print "\n"; }
In reply to Re: Append Logic
by danger
in thread Append Logic
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |