line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Package::New::Dump; |
2
|
2
|
|
|
2
|
|
30165
|
use base qw{Package::New}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
705
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
326
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION='0.06'; |
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
|
0
|
|
|
0
|
1
|
|
my $self=shift(); |
43
|
0
|
|
|
|
|
|
eval 'use Data::Dumper qw{}'; |
44
|
0
|
0
|
|
|
|
|
if ($@) { |
45
|
0
|
0
|
|
|
|
|
return wantarray ? () : ''; |
46
|
|
|
|
|
|
|
} else { |
47
|
0
|
0
|
|
|
|
|
my $depth=shift; $depth=2 unless defined $depth; |
|
0
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $d=Data::Dumper->new([$self]); |
49
|
0
|
|
|
|
|
|
$d->Maxdepth($depth); |
50
|
0
|
|
|
|
|
|
return $d->Dump; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 BUGS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Log on RT and contact the author. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SUPPORT |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
DavisNetworks.com provides support services for all Perl applications including this package. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Michael R. Davis |
65
|
|
|
|
|
|
|
CPAN ID: MRDVT |
66
|
|
|
|
|
|
|
DavisNetworks.com |
67
|
|
|
|
|
|
|
http://www.DavisNetworks.com/ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 COPYRIGHT |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This program is free software licensed under the... |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
The BSD License |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
The full text of the license can be found in the LICENSE file included with this module. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SEE ALSO |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |