Once an idea gets into my head, the only way to shake it off is to go away
and write it :)

Dave...

package Tie::Hash::Cannabinol;

use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);

require Exporter;
require Tie::Hash;

@ISA = qw(Exporter Tie::StdHash);
@EXPORT = qw();
@EXPORT_OK =();

$VERSION = '0.01';

sub FETCH {
  my $self = shift;

  my @keys = keys %$self;

  return $self->{$keys[rand $#keys]};
}

sub EXISTS {
  return rand > 0.5;
}

1;
__END__

=head1 NAME

Tie::Hash::Cannabinol - A hash on hash!

=head1 SYNOPSIS

  use Tie::Hash::Cannabinol;
  my %h;

  tie %h, 'Tie::Hash::Cannabinol';

=head1 DESCRIPTION

The idea of writing a tied hash called T::H::C was just too good to ignore.

You can store values in this hash just as you would a normal hash, but
when you ask for a value back, you get any random value from the hash.

The C<exists> function isn't really to be trusted either :)

=head1 AUTHOR

Dave Cross <[EMAIL PROTECTED]>

=head1 SEE ALSO

perl(1).

perltie(1).

=cut


The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged. If the reader 
of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  
If you have received this communication in error, please 
re-send this communication to the sender and delete the 
original message or any copy of it from your computer
system.

Reply via email to