in reply to Break the foreach loop on count on 50 and then insert a new foreach loop
Your case is more complicated because there is there also the port to be associated. But you'll do on your own.perl -e "@list=(1..7);$counter=0; foreach $it (@list){if ($counter >= +3){print qq(\n\n);$counter = 0; redo}print qq($it\n); $counter++}" 1 2 3 4 5 6 7
sub proces_no_more_than_50 { my($port,@addresses)=@_; if ($#addresses >= 50) { &execute( $port, map {shift @addresses} 1..50 ); } else{ &execute($port, @addresses); undef @addresses;} &proces_no_more_than_50($port,@addresses) if defined $addresses[0]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Break the foreach loop on count on 50 and then insert a new foreach loop
by AnomalousMonk (Archbishop) on Nov 12, 2015 at 12:08 UTC | |
by Discipulus (Canon) on Nov 12, 2015 at 12:20 UTC | |
by iamnewbie (Novice) on Nov 16, 2015 at 06:00 UTC | |
by iamnewbie (Novice) on Nov 13, 2015 at 06:19 UTC | |
by AnomalousMonk (Archbishop) on Nov 13, 2015 at 14:10 UTC | |
|
Re^2: Break the foreach loop on count on 50 and then insert a new foreach loop
by iamnewbie (Novice) on Nov 13, 2015 at 05:55 UTC |