File Coverage

blib/lib/End.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 1 0.0
total 27 28 96.4


line stmt bran cond sub pod time code
1             package End;
2              
3 1     1   541 use 5.006;
  1         2  
  1         31  
4              
5 1     1   5 use strict;
  1         1  
  1         28  
6 1     1   5 use warnings;
  1         11  
  1         30  
7 1     1   5 no warnings 'syntax';
  1         1  
  1         44  
8              
9 1     1   4 use Exporter;
  1         1  
  1         143  
10              
11             our @ISA = qw /Exporter/;
12             our @EXPORT = qw /end/;
13              
14             our $VERSION = '2009110401';
15              
16             sub end (&) {
17 10     10 0 96 my $code = shift;
18             # Due to a bug in Perl 5.6.0, we can't just bless $code.
19             # But by creating an extra closure, it'll work.
20 10     10   29 bless sub {$code -> ()} => __PACKAGE__;
  10         17  
21             }
22              
23 10     10   36 DESTROY {$_ [0] -> ()}
24              
25             1;
26              
27             __END__