| 1 | package Filter::Cleanup; | ||||||||||||||||||||
| 2 | # ABSTRACT: Execute cleanup statements when scope closes, regardless of errors | ||||||||||||||||||||
| 3 | 1 | $Filter::Cleanup::VERSION = '0.03'; | |||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use 5.012; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use Keyword::Declare; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | our $CLEANUP; | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 1 | ▶ | sub import { | ||||||||||||||||||
|
Subroutine
import: called CC=3 SCAR=12.5
| |||||||||||||||||||||
| 13 | 0 | ▶ | keyword cleanup (Block $cl, /\s*;\s/? $br) :then(Statement* $st='1') { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.9
Subroutine
__ANON__: not called CC=1 SCAR=0.9
Branch: 1 branch
Condition50%1/2
(caller 0)[3] // ""
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
| |||||||||||||||||||||
| 14 | 0 | qq{ | |||||||||||||||||||
| 15 | 0 | local \$Filter::Cleanup::CLEANUP = Filter::Cleanup->new(sub $cl); | |||||||||||||||||||
| 16 | $st | ||||||||||||||||||||
| 17 | 0 | }; | |||||||||||||||||||
| 18 | 0 | } | |||||||||||||||||||
| 19 | 0 | } | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.6
Pod
undocumented
| |||||||||||||||||||||
| 22 | 0 | my ($class, $code) = @_; | |||||||||||||||||||
| 23 | 0 | bless $code, $class; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | 0 | ||||||||||||||||||||
| 26 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||
|
Subroutine
DESTROY: called CC=2 SCAR=7.4
| |||||||||||||||||||||
| 27 | 18 | my $self = shift; | |||||||||||||||||||
| 28 | 18 | ▶ | if (defined $self) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | 18 | $self->(); | |||||||||||||||||||
| 30 | 1 | } | |||||||||||||||||||
| 31 | 1 | ▶ | } | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 32 | 1 | ||||||||||||||||||||
| 33 | 1 | 1; | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||