blib/lib/loose.pm

filter: Statementstmt 68.4% 13 / 19 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 53.5% 15 / 28 CC 3 SCAR 14.7
CC
3
Cov
57%
die
6.0
__ANON__
6.0
BEGIN
1.0
CRAP 4.3
↑ Summary
1 package loose;
2  
3 1 ▶use vars qw($VERSION @ISA @EXPORT);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 $VERSION = '0.01';
5  
6 # Just for irony value.
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 require Exporter;
10 1 @ISA = qw(Exporter);
11 1 @EXPORT = qw(die);
12  
13 1 my @excuses = ('Not my job.',
14 "I'm on my break.",
15 'Whatever.',
16 "That's nice.",
17 'So what am I supposed to do about it?',
18 'Uh huh.',
19 'Yeah, sure.',
20 'False alarm.',
21 "I don't get paid enough to care.",
22 'Talk to the union.',
23 'Not in my job description to care.'
24 );
25  
26 0 ▶sub die {
Subroutine die: not called CC=2 SCAR=17.9
Pod undocumented
27 0 ▶ if( int rand(10) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (int rand 10) { } 0 0 0
28 0 print STDERR $excuses[rand @excuses]."\n";
29 }
30 else {
31 0 CORE::die @_;
32 }
33 }
34  
35 0 ▶$SIG{__WARN__} = sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
36 0 ▶ if( int rand(10) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (int rand 10) { } 0 0 0
37 0 print STDERR $excuses[rand @excuses]."\n";
38 }
39 else {
40 0 warn @_;
41 }
42 1 };
43  
44  
45 1 return "Slacker.";
46  
47 =pod
48  
49 =head1 NAME
50  
51 loose - Perl pragma to allow unsafe constructs
52  
53 =head1 SYNOPSIS
54  
55 use loose;
56  
57 =head1 DESCRIPTION
58  
59 loose.pm provides you with a slack, casual environment in which to
60 write your Perl code. It doesn't get hung up on little things like
61 warnings and die() calls, it just lets them slide.
62  
63 Use loose.pm to help relieve stress at the work place. loose helps to
64 make your error logs shorter by getting right of all those wordly
65 warning messages.
66  
67 =head1 BUGS
68  
69 Yeah, probably. Who cares?
70  
71 =head1 AUTHOR
72  
73 Michael G Schwern <schwern@pobox.com>
74  
75 =cut
76  
↑ Summary