here/debug.pm untested

filter: Statementstmt 0.0% 0 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 14 CC 1 SCAR 6.9
CC
1
Cov
0%
import
2.0
unimport
2.0
BEGIN
2.0
CRAP 2.0
1 package here::debug;
2 use warnings;
3 use strict;
4
5 sub import {$here::DEBUG = 1}
6 sub unimport {$here::DEBUG = 0}
7
8 =head1 NAME
9
10 here::debug - enable / disable here debugging
11
12 =head1 SYNOPSIS
13
14 use here::debug;
15 use here ''.reverse '1 = x$ ym';
16 # warns "use here: my $x = 1 at file.pl line 2."
17 # and then inserts it into the source as normal.
18
19 =head2 import
20
21 use here::debug;
22
23 is the same as
24
25 BEGIN {$here::DEBUG = 1}
26
27 and causes all applications of the C< here > code injector to print the code to
28 stderr before inserting it into the source.
29
30 =head2 unimport
31
32 no here::debug;
33
34 is the same as
35
36 BEGIN {$here::DEBUG = 0}
37
38 =head1 SEE ALSO
39
40 =over 4
41
42 =item * L<here>
43
44 =item * L<here::install>
45
46 =item * L<here::declare>
47
48 =back
49
50 =head1 AUTHOR
51
52 Eric Strom, C<< <asg at cpan.org> >>
53
54 =head1 BUGS
55
56 please report any bugs or feature requests to C<bug-here at rt.cpan.org>, or
57 through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=here>.
58 I will be notified, and then you'll automatically be notified of progress on
59 your bug as I make changes.
60
61 =head1 LICENSE AND COPYRIGHT
62
63 copyright 2011 Eric Strom.
64
65 this program is free software; you can redistribute it and/or modify it under
66 the terms of either: the GNU General Public License as published by the Free
67 Software Foundation; or the Artistic License.
68
69 see http://dev.perl.org/licenses/ for more information.
70
71 =cut
72
73 1