Skip to content

Commit

Permalink
Added Attribute::Handlers interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Dec 9, 2001
1 parent 87e4864 commit 2a7a1ad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Tie/Hash/Cannabinol.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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>.
#
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2a7a1ad

Please sign in to comment.