$pre = "PRE"; @S = qw/Q PREQ/; for (@S) { $_ = $pre . $_ unless 0 == index $_, $pre; } say for @S;