Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Tie::Hash::Cannabinol

by davorg (Chancellor)
on Jun 06, 2001 at 13:54 UTC ( #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;

Comment on Tie::Hash::Cannabinol
Download Code
Re: Tie::Hash::Cannabinol
by wrboyce (Initiate) on Jan 09, 2005 at 15:11 UTC
    hmm, Tetra::Hydro tbh.

Back to Code Catacombs

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2015-07-06 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls