Help for this page

Select Code to Download


  1. or download this
    my $text = "my dog is green";
    my $count =()= $text =~ /(g)(.)/g;
    print $count;
    
  2. or download this
    my $text = "my dog is green";
    my $count;
    $count++ while $text =~ /(g)(.)/g;
    print $count;
    
  3. or download this
    my $text = "my dog is green";
    my $count = $text =~ s/(g)(.)/$1$2/g;
    print $count;