Kent Fredric via RT wrote:
Show quoted text>Could you be persuaded to add a little documentation clarifying the distinction
>? =)
I'm open to suggestions as to how to clarify it. I thought it was clear
enough already.
Show quoted text>And to clarify, how is this behaviour considered "useful"?
On the module side, it's part of a consistent pattern, that each kind
of scalar has a test of the same form. In the core, regexps are now a
distinct type mainly for transparency: previously a regexp appeared as
undef, with the actual information hidden in attached magic.
Show quoted text>Making everyone dereference prior to calling "is a regexp" seems just prone to
>cause confusion.
You'll hardly ever want to check against the REGEXP type. Regexp objects
are normally blessed into the "Regexp" package. (They've been so
blessed as long as qr// has existed; the blessing was applied in the
days of undef-with-magic, before the REGEXP type existed.) You'll want
check_blessed($v, "Regexp") instead.
-zefram