You can print out a regex:
my $re = qr/foo/; print "$re";
The stringified regex can be readily used as a regular expression again.
In reply to Re^7: Composing regex's dynamically
by Corion
in thread Composing regex's dynamically
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |