in reply to I hate nested loops
for @eths X @nets -> $eth, $net { %netifaces{$eth}{$net} = 1; }
Rakudo and Niecza both support it.
You can also do something like
for @eth { %netifaces{$eth} = ( @nets X=> 1 ).hash }
See this blog post for a description of what X and X=> do.
Update: fixed variable name in the first code example, TimToady++
|
---|