in reply to Re^2: NEXT statement in for loop
in thread NEXT statement in for loop
If the order of the values is important and the keys not then maybe use a hash of arrays (HoA)
poj#!perl use strict; my @routers = ( "R0", "R2", "R3" ); my %fpc = ( R0 => [5,4], R2 => [3,2], R3 => [1,0], ); my %pic = ( R0 => [5,4], R2 => [3,2], R3 => [1,0], ); for my $r (@routers) { print "value of r is $r\n"; for my $f (@{ $fpc{$r} }) { for my $p (@{ $pic{$r} }) { print "request chassis pic offline fpc-slot $f pic-slot $p\n"; } } }
|
|---|