X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperltie.pod;h=429a6627701c3927275f349795e10ab9c4fe51cd;hb=4e9dada01dea61250de18f52c49ec01866133705;hp=327af04b54b8c747c91a9e95bcd7ce1fe5f7599c;hpb=159b10bbeba7b6f29b26844c4a919e2a39f1feb6;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perltie.pod b/pod/perltie.pod index 327af04..429a662 100644 --- a/pod/perltie.pod +++ b/pod/perltie.pod @@ -768,6 +768,12 @@ the hash is inside an iteration. If this isn't the case, FIRSTKEY is called, and the result will be a false value if FIRSTKEY returns the empty list, true otherwise. +However, you should B blindly rely on perl always doing the right +thing. Particularly, perl will mistakenly return true when you clear the +hash by repeatedly calling DELETE until it is empty. You are therefore +advised to supply your own SCALAR method when you want to be absolutely +sure that your hash behaves nicely in scalar context. + In our example we can just call C on the underlying hash referenced by C<$self-E{LIST}>: @@ -870,7 +876,7 @@ passed to the printf function. sub PRINTF { shift; my $fmt = shift; - print sprintf($fmt, @_)."\n"; + print sprintf($fmt, @_); } =item READ this, LIST