You shouldn't ever have to think about what string ref() returns. By comparing it to a prototype of the same thing, you insulate yourself from version changes and thinkos (like me forgetting if it's REGEX, REGEXP, Regex, or Regexp):
if( ref $regex eq ref qr// ) { ... }
Or, hide that in a subroutine is_regex() or something similar.
In reply to Re: ref() and Regexp
by brian_d_foy
in thread ref() and Regexp
by tirwhan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |