The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Sub::Contract::Memoizer - Implement the caching behaviour of a contract

SYNOPSIS

See 'Sub::Contract'.

DESCRIPTION

Subroutine contracts defined with Sub::Contract can memoize the contractor's results. This optional behaviour is implemented in Sub::Contract::Memoizer.

API

See 'Sub::Contract'.

$contract->cache([size => $max_size])
$contract->has_cache([size => $max_size])
$contract->get_cache
$contract->clear_cache
$contract->add_to_cache(\@args, \@results)

SEE ALSO

See 'Sub::Contract'.

VERSION

$Id: Memoizer.pm,v 1.11 2009/06/08 19:44:28 erwan_lemonnier Exp $

AUTHOR

Erwan Lemonnier <erwan@cpan.org>

LICENSE

See Sub::Contract.