The code, $string =~ $re ;, will work in both cases:
In reply to Re^2: Passing regular expressions as arguments to subroutines
by ioannis
in thread Passing regular expressions as arguments to subroutines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |