or$pre = "PRE"; @S = qw/Q PREQ/; s/^(?!$pre)/$pre/ for @S; say for @S;
$pre = "PRE"; @S = qw/Q PREQ/; for (@S) { $_ = $pre . $_ unless 0 == index $_, $pre; } say for @S;
In reply to Re: Prepent string a to string b if b does not start with a
by choroba
in thread Prepent string a to string b if b does not start with a
by Saved
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |