Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: can we pass two variable to foreach loop

by glenn (Scribe)
on Oct 05, 2015 at 15:16 UTC ( [id://1143828]=note: print w/replies, xml ) Need Help??


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) = @$_; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1143828]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-03-19 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found