develooper Front page | perl.perl5.porters | Postings from September 2019

[perl #134452] ref should trigger warnings and doc needs work

Thread Next
Dan Book via RT
September 27, 2019 22:32
[perl #134452] ref should trigger warnings and doc needs work
Message ID:
On Thu, 26 Sep 2019 18:20:45 -0700, wrote:
> $ perldoc -f ref
> ...
>     If the referenced object has been blessed into a package, then
>     that package name is returned instead. But don't use that, as it's
>     now considered "bad practice". For one reason, an object could be
>     using a class called "Regexp" or "IO", or even "HASH". Also, "ref"
>     doesn't take into account subclasses, like "isa" does.
> Instead, use "blessed" (in the Scalar::Util module) for boolean
> checks, "isa" for specific class checks and "reftype" (also from
> Scalar::Util) for type checks. (See perlobj for details and a
> "blessed"/"isa" example.)

Note this documentation is out of date; the latest version can be viewed at .


via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About