Untested:
use List::MoreUtils qw(any); push @{$vars->{uplinks}}, $conn unless any { $conn eq $_ } @{$vars->{uplinks}};
Update: After reading sauoq's reply below, I may have misunderstood the question. The OP will have to clarify. If they are saying that if there is *anything* in the array, don't push, but then it would be probably better to get rid of the array entirely as its really not needed.
In reply to Re: Hash of array of hash access
by stevieb
in thread Hash of array of hash access
by Ransom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |