Front page | perl.perl5.porters |
Postings from October 2003
[PATCH] Tie::Hash documentation
Thread Next
From:
Slaven Rezic
Date:
October 12, 2003 10:32
Subject:
[PATCH] Tie::Hash documentation
Message ID:
200310121655.h9CGtsrY003613@vran.herceg.de
How the TIEHANDLE crept in?
Regards,
Slaven
--- bleedperl/lib/Tie/Hash.pm Mon Oct 6 06:51:46 2003
+++ bleedperl2/lib/Tie/Hash.pm Sun Oct 12 18:50:59 2003
@@ -24,7 +24,7 @@ Tie::Hash, Tie::StdHash, Tie::ExtraHash
# 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
# 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<th
The accessor methods assume that the actual storage for the data in the tied
hash is in the hash referenced by C<tied(%tiedhash)>. Thus overwritten
-C<TIEHANDLE> method should return a hash reference, and the remaining methods
+C<TIEHASH> 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 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<TIEHANDLE> method should return an array reference with the first
+C<TIEHASH> 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<TIEHANDLE> method stores "extra" arguments to tie() starting
+The default C<TIEHASH> method stores "extra" arguments to tie() starting
from offset 1 in the array referenced by C<tied(%tiedhash)>; this is the
same storage algorithm as in TIEHASH subroutine above. Hence, a typical
package inheriting from B<Tie::ExtraHash> does not need to overwrite this
--
Slaven Rezic - slaven@rezic.de
tknotes - A knotes clone, written in Perl/Tk.
http://ptktools.sourceforge.net/#tknotes
Thread Next
-
[PATCH] Tie::Hash documentation
by Slaven Rezic