return 0 if ( $line =~ s/\Q$base//g ) >= $limit;