File Coverage

blib/lib/Acme/Throw.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition 1 2 50.0
subroutine 6 6 100.0
pod n/a
total 25 26 96.1


line stmt bran cond sub pod time code
1 1     1   919 use strict;
  1         2  
  1         37  
2 1     1   5 use warnings;
  1         2  
  1         46  
3             package Acme::Throw;
4              
5             # ABSTRACT: For when code makes you want to throw something.
6              
7 1     1   15 use utf8;
  1         2  
  1         7  
8              
9             our $MSG;
10              
11             sub import {
12 2     2   391 my ($class, %args) = @_;
13              
14 2   50     12 $MSG = $args{-msg} || "WHY WON'T THIS CODE WORK??!?";
15 2         8 my $orig_handler = $SIG{__DIE__};
16              
17             $SIG{__DIE__} = sub {
18 2     2   1690 binmode(STDERR, ":utf8");
19 2         83 print STDERR "(╯°□°)╯︵ ┻━┻ $MSG\n";
20 2         6 $SIG{__DIE__} = $orig_handler;
21 2         15 die @_;
22 2         19 };
23             }
24              
25 1     1   948 sub _msg { $MSG }
26              
27             1 && q{ THIS IS MY RAGE FACE }; # truth
28             __END__