print "$k => $v\n";
}
-Perl will raise an exception if you try to delete keys from a pseudo-hash
-or try to access nonexistent fields. For better performance, Perl can also
+Perl will raise an exception if you try to access nonexistent fields.
+For better performance, Perl can also
do the translation from field names to array indices at compile time for
typed object references. See L<fields>.
+There are two ways to check for the existence of a key in a
+pseudo-hash. The first is to use exists(). This checks to see if the
+given field has ever been set. It acts this way to match the behavior
+of a regular hash. For instance:
+
+ $phash = [{foo =>1, bar => 2, pants => 3}, 'FOO'];
+ $phash->{pants} = undef;
+
+ print exists $phash->{foo}; # true, 'foo' was set in the declaration
+ print exists $phash->{bar}; # false, 'bar' has not been used.
+ print exists $phash->{pants}; # true, your 'pants' have been touched
+
+The second is to use exists() on the hash reference sitting in the
+first array element. This checks to see if the given key is a valid
+field in the pseudo-hash.
+
+ print exists $phash->[0]{bar}; # true, 'bar' is a valid field
+ print exists $phash->[0]{shoes};# false, 'shoes' can't be used
+
+delete() on a pseudo-hash element only deletes the value corresponding
+to the key, not the key itself. To delete the key, you'll have to
+explicitly delete it from the first hash element.
+
+ print delete $phash->{foo}; # prints $phash->[1], "FOO"
+ print exists $phash->{foo}; # false
+ print exists $phash->[0]{foo}; # true, key still exists
+ print delete $phash->[0]{foo}; # now key is gone
+ print $phash->{foo}; # runtime exception
+
=head2 Function Templates
As explained above, a closure is an anonymous function with access to the