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

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

Thread Next
March 8, 2001 23:14
[ID 19990808.001] [DOC PATCH] FETCH triggered on exists()
Message ID:

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.

(If you choose to apply this patch, the bug can be easily closed by

--- 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About