Help for this page

Select Code to Download


  1. or download this
    $pre = "PRE";
    @S = qw/Q PREQ/;
    s/^(?!$pre)/$pre/ for @S;
    say for @S;
    
  2. or download this
    $pre = "PRE";
    @S = qw/Q PREQ/;
    for (@S) {
        $_ = $pre . $_ unless 0 == index $_, $pre;
    }
    say for @S;