| 1 | package Attribute::Memoize; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use Attribute::Handlers; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | our $VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)/g; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 3 | ▶ | sub UNIVERSAL::Memoize :ATTR(CODE) { | ||||||||||||||||||||||||||
|
Subroutine
Memoize: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 3 | my ($pkg, $symbol, $options) = @_[0,1,4]; | |||||||||||||||||||||||||||
| 11 | 3 | ▶ | $options = [ $options || () ] unless ref $options eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$options || ()
MC/DC0%0/2
$options || ()
$options
()
Truth table33%1/3
A || B
A= $optionsB= ()
| |||||||||||||||||||||||||||||
| 12 | 3 | require Memoize; | |||||||||||||||||||||||||||
| 13 | 3 | Memoize::memoize($pkg . '::' . *{$symbol}{NAME}, @$options); | |||||||||||||||||||||||||||
| 14 | 4 | ▶ | } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 4 | "Rosebud"; # for MARCEL's sake, not 1 -- dankogai | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | __END__ | ||||||||||||||||||||||||||||