Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 lurking in the Monastery: (7)
As of 2014-12-28 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls