Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: can we pass two variable to foreach loop

by glenn (Scribe)
on Oct 05, 2015 at 15:16 UTC ( #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? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-01-17 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?