my @r = qw/h1 h2/ ; my $rh = JT->new( host => $r[0] ); my $rh = JT->new( host => $r[1] ); my $output; my $key; my $value; my @routers =($r[0], $r[1]); my @router = ( "R0", "R1", "R2" ); my %fpc = ( R0 => [5,4], R1 => [3,2], R2 => [1,0], ); my %pic = ( R0 => [5,4], R1 => [3,2], R2 => [1,0], ); ); @router = ( "R0", "R1", "R2" ); for my $rh (@routers) { my $r = shift(@router); print "value of r is $r\n"; my $count = 0; for my $f (@{ $fpc{$r} }) { # for my $p (@{ $pic{$r} }) { my $p = (@{ $pic{$r} })[$count]; print "request chassis pic offline fpc-slot $f pic-slot $p\n"; $count++; #} } }