if ($line !~ /\b$word\b/) { ... }