Tie::Memoize

Tie::Memoize

NAME

Tie::Memoize - add data to hash when needed

SYNOPSIS

require Tie::Memoize;
tie %hash, 'Tie::Memoize',
    \&fetch,			# The rest is optional
    $DATA, \&exists,
    {%ini_value}, {%ini_existence};

DESCRIPTION

This package allows a tied hash to autoload its values on the first access, and to use the cached value on the following accesses.

Only read-accesses (via fetching the value or exists登录查看完整内容