if ($line !~ /\b$word\b/) { ... } #### substr($string,0,1) = undef; #### my $str = '"hello, my name is Bob, my cell number is, 1234567890"'; $str =~ s/,[^,]*"$/"/; print "$str\n";