Permalink
Browse files

Added Attribute::Handlers interface.

  • Loading branch information...
1 parent 87e4864 commit 2a7a1adc02b9868fc6e2864c25f8b76b757b32ea @davorg committed Dec 9, 2001
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/Tie/Hash/Cannabinol.pm
View
9 lib/Tie/Hash/Cannabinol.pm
@@ -15,6 +15,9 @@
# $Id$
#
# $Log$
+# Revision 1.4 2001/12/09 19:12:54 dave
+# Added Attribute::Handlers interface.
+#
# Revision 1.3 2001/09/05 19:48:15 dave
# fixed a very serious bug where instead of returning a random value from the hash we were, in fact, almost always returning C<undef>.
#
@@ -30,6 +33,7 @@ package Tie::Hash::Cannabinol;
use strict;
use vars qw($VERSION @ISA);
use Tie::Hash;
+use Attribute::Handlers autotie => { __CALLER__::Stoned => __PACKAGE__ };
$VERSION = sprintf "%d.%02d", '$Revision$ ' =~ /(\d+)\.(\d+)/;
@ISA = qw(Tie::StdHash);
@@ -71,9 +75,14 @@ Tie::Hash::Cannabinol - Perl extension for creating hashes that forget things
my %hash;
tie %hash, 'Tie::Hash::Cannabinol';
+or
+
+ my %hash : Stoned;
+
# % hash can now be treated exactly like a normal hash - but don't trust
# anything it tells you.
+
=head1 DESCRIPTION
Tie::Hash::Cannabinol is a completely useless demonstration of how to use

0 comments on commit 2a7a1ad

Please sign in to comment.