| blib/lib/Perl/AtEndOfScope.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 20 | 20 | 100.0 |
| branch | n/a | ||
| condition | 1 | 3 | 33.3 |
| subroutine | 5 | 5 | 100.0 |
| pod | 1 | 1 | 100.0 |
| total | 27 | 29 | 93.1 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Perl::AtEndOfScope; | ||||||
| 2 | |||||||
| 3 | 1 | 1 | 33528 | use 5.008; | |||
| 1 | 3 | ||||||
| 1 | 36 | ||||||
| 4 | 1 | 1 | 6 | use strict; | |||
| 1 | 2 | ||||||
| 1 | 38 | ||||||
| 5 | 1 | 1 | 15 | use warnings; | |||
| 1 | 6 | ||||||
| 1 | 222 | ||||||
| 6 | |||||||
| 7 | our $VERSION = '0.03'; | ||||||
| 8 | our $EXC; | ||||||
| 9 | |||||||
| 10 | sub new { | ||||||
| 11 | 5 | 5 | 1 | 2748 | my $class=shift; | ||
| 12 | 5 | 13 | my $I=[@_]; | ||||
| 13 | 5 | 33 | 39 | return bless $I=>(ref($class)||$class); | |||
| 14 | } | ||||||
| 15 | |||||||
| 16 | sub DESTROY { | ||||||
| 17 | 5 | 5 | 853 | my ($fn, @args)=@{$_[0]}; | |||
| 5 | 19 | ||||||
| 18 | 5 | 7 | undef $EXC; | ||||
| 19 | { | ||||||
| 20 | 5 | 7 | local ($@, $a, $b, $_, $., $!, $^E, $?); | ||||
| 5 | 43 | ||||||
| 21 | 5 | 9 | eval {$fn->(@args)}; | ||||
| 5 | 16 | ||||||
| 22 | 5 | 61 | $EXC=$@; | ||||
| 23 | } | ||||||
| 24 | } | ||||||
| 25 | |||||||
| 26 | 1; | ||||||
| 27 | |||||||
| 28 | __END__ |