if ($packets[$i] =~ /$str/g) { ++$all{$str}; }