No such thing as a small change | |
PerlMonks |
Re: Freezing a regular expression qr()by choroba (Cardinal) |
on Sep 06, 2017 at 12:10 UTC ( [id://1198767]=note: print w/replies, xml ) | Need Help?? |
You can use the convert_blessed option. To add a TO_JSON method to regexes, just define it in the ref qr() namespace, i.e. Regexp :
Update: You can even localize the change, so that regexes behave normally in other parts of the code:
In Section
Seekers of Perl Wisdom
|
|