8.219. Tie::MemoizeAdds data to the hash when needed. That is, Tie::Memoize allows a tied hash to autoload all its values on first access and to use the cached value on subsequent accesses. Read accesses will result in one of the Tie::Memoize functions being called. Write accesses will act as if you're operating on a normal hash. For example: #!/usr/local/bin/perl -w require Tie::Memoize; tie %hash, 'Tie::Memoize', \&fetch, $DATA, \&exists, {%ini_value}, {%ini_existence}; sub fetch { ... } sub exists { ... } Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|