import Devel-Size 0.50 from CPAN
[p5sagit/Devel-Size.git] / Size.pm
1 package Devel::Size;
2
3 use strict;
4 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD %EXPORT_TAGS);
5
6 require Exporter;
7 require DynaLoader;
8
9 @ISA = qw(Exporter DynaLoader);
10
11 # Items to export into callers namespace by default. Note: do not export
12 # names by default without a very good reason. Use EXPORT_OK instead.
13 # Do not simply export all your public functions/methods/constants.
14
15 # This allows declaration       use Devel::Size ':all';
16 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
17 # will save memory.
18 %EXPORT_TAGS = ( 'all' => [ qw(
19         size, total_size
20 ) ] );
21
22 @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
23
24 @EXPORT = qw(
25         
26 );
27 $VERSION = '0.50';
28
29 bootstrap Devel::Size $VERSION;
30
31 # Preloaded methods go here.
32
33 1;
34 __END__
35 # Below is stub documentation for your module. You better edit it!
36
37 =head1 NAME
38
39 Devel::Size - Perl extension for finding the memory usage of perl variables
40
41 =head1 SYNOPSIS
42
43   use Devel::Size qw(size);
44   $size = size("abcde");
45   $other_size = size(\@foo);
46
47 =head1 DESCRIPTION
48
49 This module figures out the real sizes of perl variables. Call it with
50 a reference to the variable you want the size of. If you pass in a
51 plain scalar it returns the size of that scalar. (Just be careful if
52 you're asking for the size of a reference, as it'll follow the
53 reference if you don't reference it first)
54
55 =head2 EXPORT
56
57 None by default.
58
59 =head1 BUGS
60
61 Doesn't currently walk all the bits for code refs, globs, formats, and
62 IO. Those throw a warning, but a minimum size for them is returned.
63
64 Also, this module currently only returns the size used by the variable
65 itself, I<not> the contents of arrays or hashes, nor does it follow
66 references past one level. That's for later.
67
68 =head1 AUTHOR
69
70 Dan Sugalski dan@sidhe.org
71
72 =head1 SEE ALSO
73
74 perl(1).
75
76 =cut