try natatime in List::MoreUtils, maybe it makes your code more elegant? ;)
use List::MoreUtils qw/natatime/;
my @contents = <DATA>;
my $it = natatime 8, @contents;
while (my @vals = $it->())
print "@vals[0,1,2] \n" if $vals =~ /jack/;
The another advantage of this approach compared to other way is you won't lose the rest part of every chunk. you can print any elements of @vals by changing slice.
I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction