in reply to Re^3: Check if a word is included in another
in thread Check if a word is included in another

Not the same, with or without /g makes a big difference in this case.

use warnings; use strict; my $str1 = "112345"; $str1 =~ s/1//g; print $str1, "\n"; my $str2 = "112345"; $str2 =~ s/1//; print $str2, "\n";

Peter (Guo) Pei

Replies are listed 'Best First'.
Re^5: Check if a word is included in another
by b4swine (Pilgrim) on Apr 18, 2010 at 23:18 UTC
    I mean the original original post, where the question was first asked by me. There are no s///g in that post.