This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #133751) qr// is already blessed
authorTony Cook <tony@develop-help.com>
Tue, 15 Jan 2019 22:42:16 +0000 (09:42 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 22 Jan 2019 03:33:58 +0000 (14:33 +1100)
pod/perlfunc.pod

index 7c37a0e..973a261 100644 (file)
@@ -6379,7 +6379,9 @@ C<HASH>, C<CODE>, C<FORMAT>, or C<IO>, indicating only which kind of
 object it is.  If the unblessed referent is a scalar, then the return
 value will be one of the strings C<SCALAR>, C<VSTRING>, C<REF>, C<GLOB>,
 C<LVALUE>, or C<REGEXP>, depending on the kind of value the scalar
-currently has.  Beware that these built-in type names can also be used as
+currently has.   But note that C<qr//> scalars are created already
+blessed, so C<ref qr/.../> will likely return C<Regexp>.  Beware that
+these built-in type names can also be used as
 class names, so C<ref> returning one of these names doesn't unambiguously
 indicate that the referent is of the kind to which the name refers.