in reply to Need script help

Here's a nice pattern for this kind of thing:
my @servers = qw( foo bar baz quux ); while (@servers) { my @group = splice @servers, 0, 3; print "group: @group\n"; }
ALWAYS ALWAYS ALWAYS put "use strict;" at the top of your script. If you are learning Perl from a book that doesn't explain strict, you need a better book.

Replies are listed 'Best First'.
Re^2: Need script help
by Anonymous Monk on Sep 22, 2016 at 20:34 UTC
    Also, since you're writing in Perl and not a shell script, you can do a way with the tempfile and grepping.
    open my $DATA, "wlsendpts blah blah blah |" or die; while (<$DATA>) { next unless /End/ && !/tcp3/ && /reg/; # do whatever with this line of output }