Help for this page

Select Code to Download


  1. or download this
    $string =~ s/a/i/ for 1 .. $N;
    
  2. or download this
    my $count = 0;
    $string =~ s/a(??{++ $count <= $N ? "(*ACCEPT)" : "(*FAIL)"})/i/g;
    # Use '""' instead of '(*ACCEPT)' and '(?!)' instead of '(*FAIL)' on o
    +ld Perls.