develooper Front page | perl.perl5.porters | Postings from March 2001

[ID 19990808.001] [DOC PATCH] FETCH triggered on exists()

Thread Next
From:
rspier
Date:
March 8, 2001 23:14
Subject:
[ID 19990808.001] [DOC PATCH] FETCH triggered on exists()
Message ID:
15016.33515.343871.472176@rls.cx

Searching the BugDB for easy ones to close.  A quick summary is that
Mark discovered that exists() will trigger a FETCH if the EXISTS method
returns undef.  It was noted that this isn't documented anywhere.  The
patch below solves this issue.

http://bugs.perl.org/perlbug.cgi?req=bidmids&bidmids=19990808.001&range=23873&format=H

(If you choose to apply this patch, the bug can be easily closed by
BCCing close_19990808.001@bugs.perl.org)

--- perltie.pod.orig    Fri Mar  9 02:03:59 2001
+++ perltie.pod Fri Mar  9 02:09:41 2001
@@ -725,6 +725,10 @@
        return exists $self->{LIST}->{$dot};
     }
 
+If your method returns undef (as opposed to a true or false value)
+perl will attempt to satisfy the exists() function by triggering a C<FETCH>.
+If C<FETCH> returns a true value, exists() will be true.
+
 =item FIRSTKEY this
 
 This method will be triggered when the user is going



Thread Next


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