Updates to modules-related pod
[p5sagit/p5-mst-13.2.git] / pod / perltie.pod
index 468855c..429a662 100644 (file)
@@ -763,10 +763,16 @@ thing, but we'll have to go through the LIST field indirectly.
 This is called when the hash is evaluated in scalar context. In order
 to mimic the behaviour of untied hashes, this method should return a
 false value when the tied hash is considered empty. If this method does
-not exist, perl will make some educated guesses and return false when
-the hash is not inside an iteration. In this case, FIRSTKEY is called
-and the result will be a false value if FIRSTKEY returns the empty list,
-true otherwise.
+not exist, perl will make some educated guesses and return true when
+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<not> 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<scalar> on the underlying hash
 referenced by C<$self-E<gt>{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