NAME

cacheData - Class to hold and work with a piece of data for the cacheHandler-class.

SYNOPSIS

 use cacheData;

 # instantiate the class
 my $d=cacheData->new();

 # set the data of the instance
 my %h;
 $h{whatever}="somedata";
 $h{thisandthat}="someotherdata";
 $d->set(\%h);

 # get the data of the instance
 my $data=$d->get();
 

DESCRIPTION

A class to work with a piece of data in the cacheHandler-class. It support setting and getting the data, including adding an identifier for the data.

CONSTRUCTOR

new()

Constructor. Instantiate a cacheData-class.

Input accepts the following parameters:

Returns an instance of the class upon success.

METHODS

set()

Sets the piece of data that the instance contains.

It only accepts one parameter which is the data to store. The data can either be a SCALAR or a variable-reference.

Returns 1.

get()

Gets the piece of data that the instance contains.

If the piece of data returned was a reference to a SCALAR, the SCALAR itself is returned. If the data is anything else, the method just returns the piece of data.

id()

Returns the unique ID of the instance.

No parameters accepted.

The returned ID is a SCALAR.