I had fixed my code with below resolution
# Build up the match string portion of the iptables command: my @addresses2 = @$addresses; # Before Splice take backup in +to another variable while (scalar @addresses2) { my $matchString = "-m state"; $matchString .= " --state NEW"; $matchString .= " -m ${transport}"; $matchString .= " --protocol ${transport}"; $matchString .= " --dport ${portNum}"; $matchString .= " -s " . join(',', splice(@addresses2 +, 0, 50)); $matchString .= " -j ACCEPT"; # # Build the full command: my $cmd = "${appendCmd} --match=\"${matchString}\"";
In reply to Re^3: Break the foreach loop on count on 50 and then insert a new foreach loop
by iamnewbie
in thread Break the foreach loop on count on 50 and then insert a new foreach loop
by iamnewbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |