line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Package::New::Dump; |
2
|
3
|
|
|
3
|
|
144452
|
use base qw{Package::New}; |
|
3
|
|
|
|
|
24
|
|
|
3
|
|
|
|
|
658
|
|
3
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
83
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
384
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION='0.08'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Package::New::Dump - Simple base package from which to inherit |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package My::Package; |
15
|
|
|
|
|
|
|
use base qw{Package::New::Dump}; #provides new, initialize and dump |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
The Package::New::Dump object provides a consistent object constructor for objects. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 RECOMMENDATIONS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
I recommend using this package only during development and reverting back to L when in full production |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 USAGE |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
See L |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 dump |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Returns the object serialized by L |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub dump { |
42
|
7
|
|
|
7
|
1
|
10035
|
my $self = shift; |
43
|
7
|
|
|
|
|
12
|
my $depth = shift; |
44
|
7
|
100
|
|
|
|
21
|
$depth = 2 unless defined $depth; |
45
|
7
|
|
|
|
|
11
|
local $@; |
46
|
7
|
|
|
2
|
|
438
|
eval 'use Data::Dumper qw{}'; |
|
2
|
|
|
2
|
|
646
|
|
|
1
|
|
|
1
|
|
6822
|
|
|
1
|
|
|
1
|
|
12
|
|
|
2
|
|
|
1
|
|
38
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
47
|
7
|
|
|
|
|
383
|
my $error = $@; |
48
|
7
|
100
|
|
|
|
31
|
if ($error) { |
49
|
2
|
100
|
|
|
|
9
|
return wantarray ? () : ''; |
50
|
|
|
|
|
|
|
} else { |
51
|
5
|
|
|
|
|
26
|
my $d = Data::Dumper->new([$self]); |
52
|
5
|
|
|
|
|
134
|
$d->Maxdepth($depth); |
53
|
5
|
|
|
|
|
35
|
return $d->Dump; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 BUGS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Log on RT and contact the author. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 SUPPORT |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
DavisNetworks.com provides support services for all Perl applications including this package. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AUTHOR |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Michael R. Davis |
68
|
|
|
|
|
|
|
CPAN ID: MRDVT |
69
|
|
|
|
|
|
|
DavisNetworks.com |
70
|
|
|
|
|
|
|
http://www.DavisNetworks.com/ |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 COPYRIGHT |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This program is free software licensed under the... |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
The BSD License |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
The full text of the license can be found in the LICENSE file included with this module. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 SEE ALSO |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |