File Coverage

blib/lib/XML/Smart/Shared.pm
Criterion Covered Total %
statement 16 20 80.0
branch n/a
condition n/a
subroutine 7 10 70.0
pod n/a
total 23 30 76.6


line stmt bran cond sub pod time code
1             package XML::Smart::Shared ;
2              
3 11     11   253 use 5.006 ;
  11         111  
  11         1394  
4              
5 11     11   70 use strict ;
  11         21  
  11         358  
6 11     11   56 use warnings FATAL => 'all' ;
  11         20  
  11         495  
7              
8 11     11   56 use Exporter 'import' ;
  11         20  
  11         2871  
9              
10             =head1 NAME
11              
12             XML::Smart::Shared - Shared functions and variables for XML::Smart.
13              
14             =head1 VERSION
15              
16             Version 0.01
17              
18             =cut
19              
20             our $VERSION = '0.01';
21              
22              
23             =head1 SYNOPSIS
24              
25             Shared functions and variables for XML::Smart.
26              
27             =head1 EXPORT
28              
29             All functions are exported through export_ok
30              
31             =cut
32              
33             our @EXPORT_OK = qw(_unset_sig_warn _reset_sig_warn SIG_WARN _unset_sig_die _reset_sig_die SIG_DIE );
34              
35             =head1 GLOBAL VARIABLES
36              
37             our ( $SIG_WARN , $SIG_DIE ) ;
38              
39             =cut
40              
41             my ( $SIG_WARN , $SIG_DIE ) ;
42              
43             =head1 SUBROUTINES/METHODS
44              
45             =head2 _unset_sig_warn
46              
47             This function saves current __WARN__ and sets it to none.
48              
49             =cut
50              
51             sub _unset_sig_warn {
52 8895     8895   17591 $SIG_WARN = $SIG{__WARN__} ;
53 8895     18985   40191 $SIG{__WARN__} = sub {} ;
  18985         91476  
54             }
55              
56             =head2 _reset_sig_warn
57              
58             This function replaces __WARN__ with value saved by _unset_sig_warn
59              
60             =cut
61              
62             sub _reset_sig_warn {
63 8791     8791   24401 $SIG{__WARN__} = $SIG_WARN ;
64             }
65              
66              
67             =head2 _unset_sig_die
68              
69             This function saves current __DIE__ and sets it to none.
70              
71             =cut
72              
73             sub _unset_sig_die {
74 0     0     $SIG_DIE = $SIG{__DIE__} ;
75 0     0     $SIG{__DIE__} = sub {} ;
  0            
76             }
77              
78             =head2 _reset_sig_die
79              
80             This function replaces __DIE__ with value saved by _unset_sig_warn
81              
82             =cut
83              
84             sub _reset_sig_die {
85 0     0     $SIG{__DIE__} = $SIG_DIE ;
86             }
87              
88              
89             =head1 AUTHOR
90              
91             Harish Madabushi, C<< >>
92              
93             =head1 BUGS
94              
95             Please report any bugs or feature requests to C, or through
96             the web interface at L. Both the author and the
97             maintainer will be notified, and then you'll automatically be notified of progress on your bug as changes are made.
98              
99             =head1 SUPPORT
100              
101             You can find documentation for this module with the perldoc command.
102              
103             perldoc XML::Smart
104              
105             You can also look for information at:
106              
107             =over 5
108              
109             =item * RT: CPAN's request tracker (report bugs here)
110              
111             L
112              
113             =item * AnnoCPAN: Annotated CPAN documentation
114              
115             L
116              
117             =item * CPAN Ratings
118              
119             L
120              
121             =item * Search CPAN
122              
123             L
124              
125             =item * GitHub CPAN
126              
127             L
128              
129             =back
130              
131             =head1 LICENSE AND COPYRIGHT
132              
133             Copyright 2013 Harish Madabushi.
134              
135             This program is free software; you can redistribute it and/or modify it
136             under the terms of the the Artistic License (2.0). You may obtain a
137             copy of the full license at:
138              
139             L
140              
141             Any use, modification, and distribution of the Standard or Modified
142             Versions is governed by this Artistic License. By using, modifying or
143             distributing the Package, you accept this license. Do not use, modify,
144             or distribute the Package, if you do not accept this license.
145              
146             If your Modified Version has been derived from a Modified Version made
147             by someone other than you, you are nevertheless required to ensure that
148             your Modified Version complies with the requirements of this license.
149              
150             This license does not grant you the right to use any trademark, service
151             mark, tradename, or logo of the Copyright Holder.
152              
153             This license includes the non-exclusive, worldwide, free-of-charge
154             patent license to make, have made, use, offer to sell, sell, import and
155             otherwise transfer the Package with respect to any patent claims
156             licensable by the Copyright Holder that are necessarily infringed by the
157             Package. If you institute patent litigation (including a cross-claim or
158             counterclaim) against any party alleging that the Package constitutes
159             direct or contributory patent infringement, then this Artistic License
160             to you shall terminate on the date that such litigation is filed.
161              
162             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
163             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
164             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
165             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
166             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
167             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
168             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
169             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
170              
171              
172             =cut
173              
174             1; # End of XML::Smart::Shared