initial import of Devel-Size 0.01 from CPAN
[p5sagit/Devel-Size.git] / Size.pm
1 package Devel::Size;
2
3 require 5.005_62;
4 use strict;
5 use warnings;
6
7 require Exporter;
8 require DynaLoader;
9
10 our @ISA = qw(Exporter DynaLoader);
11
12 # Items to export into callers namespace by default. Note: do not export
13 # names by default without a very good reason. Use EXPORT_OK instead.
14 # Do not simply export all your public functions/methods/constants.
15
16 # This allows declaration       use Devel::Size ':all';
17 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
18 # will save memory.
19 our %EXPORT_TAGS = ( 'all' => [ qw(
20         size
21 ) ] );
22
23 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
24
25 our @EXPORT = qw(
26         
27 );
28 our $VERSION = '0.01';
29
30 bootstrap Devel::Size $VERSION;
31
32 # Preloaded methods go here.
33
34 1;
35 __END__
36 # Below is stub documentation for your module. You better edit it!
37
38 =head1 NAME
39
40 Devel::Size - Perl extension for finding the memory usage of perl variables
41
42 =head1 SYNOPSIS
43
44   use Devel::Size qw(size);
45   $size = size("abcde");
46   $other_size = size(\@foo);
47
48 =head1 DESCRIPTION
49
50 This module figures out the real sizes of perl variables. Call it with
51 a reference to the variable you want the size of. If you pass in a
52 plain scalar it returns the size of that scalar. (Just be careful if
53 you're asking for the size of a reference, as it'll follow the
54 reference if you don't reference it first)
55
56 =head2 EXPORT
57
58 None by default.
59
60 =head1 BUGS
61
62 Only does plain scalars and arrays. No sizes for hashes, globs, code refs, or magic scalars. Yet.
63
64 Also, this module currently only returns the size used by the variable
65 itself, E<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