in reply to can we pass two variable to foreach loop
Made an amalgamation of two of the suggestions plus added a condition which is what I needed. Hope you find it useful. Basically my systems always have a left IP some have a peer system.
for (["Left",$system->{ip}->[0]], (["Right",$system->{peer}->[0]->{ip} +->[0]])x!!(exists $system->{peer})) { my ($side, $ip) = @$_; }
|
---|
In Section
Seekers of Perl Wisdom