my @matches = grep /\Q$search\E/i, @array; if (@matches > 12) { print @matches-12, " matches ignored
\n"; $#matches = 11; } while (my @row = splice(@matches, 0, 3)) { print "\n"; for my $item (@row) { my ($category,$item_name,$item_price,$item_picture)=split(/\|/,$item); print <
$item_name
$item_price
End_of_line } print "\n"; }