develooper Front page | perl.perl5.porters | Postings from December 2017

Re: [perl #114786] EXISTS and SCALAR return values are treateddifferently

From:
Zefram
Date:
December 15, 2017 05:33
Subject:
Re: [perl #114786] EXISTS and SCALAR return values are treateddifferently
Message ID:
20171215053328.GO25404@fysh.org
The behaviour is not a bug, and indeed it's a general feature of the tied
interfaces that the tied methods only get to return the kind of thing that
the vanilla internals could have returned.  That means EXISTS only gets
to return a truth value.  SCALAR gets to return a general scalar, because
the vanilla behaviour of a hash in scalar context returns something with
more content than a truth value.  This ticket should be closed.

-zefram



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About