in reply to ref() and Regexp
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ref() and Regexp
by ikegami (Patriarch) on Jan 31, 2008 at 20:02 UTC | |
by HeatSeekerCannibal (Beadle) on Feb 01, 2008 at 01:26 UTC | |
|
Re^2: ref() and Regexp
by Anonymous Monk on Sep 13, 2009 at 10:37 UTC | |
by JadeNB (Chaplain) on Dec 16, 2009 at 00:09 UTC |