# this came from somewhere else
$regex = "s/a/b/g";
# now apply it to my string
$string = "apple\n";
eval("\$string =~ $regex");
print $string;
I half expected this to work:
$string =~ $regex;
But in fact it seems to do nothing. In reply to Exec'ing a regex stored in a scalar variable by brycen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |