Help for this page

Select Code to Download


  1. or download this
    $ perl -e 'my $string = "foobarfoofoobarfoo"; my $count = $string =~ s
    +/foo/foo/g; print $count;'
    4
    
  2. or download this
    my $count = $string =~ s/\bfoo\b/foo/g;