Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Tie::Hash::Cannabinol

by davorg (Chancellor)
on Jun 06, 2001 at 13:54 UTC ( [id://86157]=sourcecode: print w/replies, xml ) Need Help??
Category: Fun Stuff
Author/Contact Info Dave Cross <dave@dave.org.uk>
Description:

The idea of writing a module that could be called T::H::C was too good to ignore.

Don't trust anything this hash tells you :)

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;
Replies are listed 'Best First'.
Re: Tie::Hash::Cannabinol
by wrboyce (Initiate) on Jan 09, 2005 at 15:11 UTC
    hmm, Tetra::Hydro tbh.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://86157]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found