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 reply to Re: can we pass two variable to foreach loop
by glenn
in thread can we pass two variable to foreach loop
by phemal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |