Help for this page

Select Code to Download


  1. or download this
    my $SUBS='s/AA/BB/g';
    $STR = "AAXXXAA";
    eval "\$STR =~ $SUBS;";
    print $STR, "\n";
    
  2. or download this
    my $lh_sub = "AA";
    my $rh_sub = "BB";
    $STR = "AAXXXAA";
    $STR =~ s/$lh_sub/$rh_sub/g;
    print $STR, "\n";