diff options
author | Michael G. Schwern <schwern@pobox.com> | 2002-08-06 06:05:10 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-17 00:51:19 +0000 |
commit | 6d822dc4045278fb03135b2683bac92dba061369 (patch) | |
tree | 39e9aa0ce54a7caf711f12d43985793b79fb762d /lib/overload.pm | |
parent | 485894a1e3cb3873ba7373c744a8b6231190fbf8 (diff) | |
download | perl-6d822dc4045278fb03135b2683bac92dba061369.tar.gz |
Remove pseudo-hashes (complete)
Message-id: <20020806200510.GC31473@ool-18b93024.dyn.optonline.net>
p4raw-id: //depot/perl@17725
Diffstat (limited to 'lib/overload.pm')
-rw-r--r-- | lib/overload.pm | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/overload.pm b/lib/overload.pm index fb1a0d1236..99af00fadc 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -922,10 +922,7 @@ numeric value.) This prints: =head2 Two-face references Suppose you want to create an object which is accessible as both an -array reference and a hash reference, similar to the -L<pseudo-hash|perlref/"Pseudo-hashes: Using an array as a hash"> -builtin Perl type. Let's make it better than a pseudo-hash by -allowing index 0 to be treated as a normal element. +array reference and a hash reference. package two_refs; use overload '%{}' => \&gethash, '@{}' => sub { $ {shift()} }; |