From: Slaven Rezic Date: Sun, 12 Oct 2003 18:55:54 +0000 (+0200) Subject: Tie::Hash documentation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15634f32600dfd7c267231a107a89655e6a68433;p=p5sagit%2Fp5-mst-13.2.git Tie::Hash documentation Message-Id: <200310121655.h9CGtsrY003613@vran.herceg.de> p4raw-id: //depot/perl@21439 --- diff --git a/lib/Tie/Hash.pm b/lib/Tie/Hash.pm index 397272b..c28e828 100644 --- a/lib/Tie/Hash.pm +++ b/lib/Tie/Hash.pm @@ -24,7 +24,7 @@ Tie::Hash, Tie::StdHash, Tie::ExtraHash - base class definitions for tied hashes # All methods provided by default, define only those needing overrides # Accessors access the storage in %{$_[0]}; - # TIEHANDLE should return a reference to the actual storage + # TIEHASH should return a reference to the actual storage sub DELETE { ... } package NewExtraHash; @@ -34,7 +34,7 @@ Tie::Hash, Tie::StdHash, Tie::ExtraHash - base class definitions for tied hashes # All methods provided by default, define only those needing overrides # Accessors access the storage in %{$_[0][0]}; - # TIEHANDLE should return an array reference with the first element being + # TIEHASH should return an array reference with the first element being # the reference to the actual storage sub DELETE { $_[0][1]->('del', $_[0][0], $_[1]); # Call the report writer @@ -110,7 +110,7 @@ Clear all values from the tied hash I. The accessor methods assume that the actual storage for the data in the tied hash is in the hash referenced by C. Thus overwritten -C method should return a hash reference, and the remaining methods +C method should return a hash reference, and the remaining methods should operate on the hash referenced by the first argument: package ReportHash; @@ -131,7 +131,7 @@ should operate on the hash referenced by the first argument: The accessor methods assume that the actual storage for the data in the tied hash is in the hash referenced by C<(tied(%tiedhash))[0]>. Thus overwritten -C method should return an array reference with the first +C method should return an array reference with the first element being a hash reference, and the remaining methods should operate on the hash C<< %{ $_[0]->[0] } >>: @@ -149,7 +149,7 @@ hash C<< %{ $_[0]->[0] } >>: $_[0][0]{$_[1]} = $_[2] } -The default C method stores "extra" arguments to tie() starting +The default C method stores "extra" arguments to tie() starting from offset 1 in the array referenced by C; this is the same storage algorithm as in TIEHASH subroutine above. Hence, a typical package inheriting from B does not need to overwrite this