initial import of Devel-Size 0.01 from CPAN
[p5sagit/Devel-Size.git] / Size.pm
CommitLineData
e98cedbf 1package Devel::Size;
2
3require 5.005_62;
4use strict;
5use warnings;
6
7require Exporter;
8require DynaLoader;
9
10our @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.
19our %EXPORT_TAGS = ( 'all' => [ qw(
20 size
21) ] );
22
23our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
24
25our @EXPORT = qw(
26
27);
28our $VERSION = '0.01';
29
30bootstrap Devel::Size $VERSION;
31
32# Preloaded methods go here.
33
341;
35__END__
36# Below is stub documentation for your module. You better edit it!
37
38=head1 NAME
39
40Devel::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
50This module figures out the real sizes of perl variables. Call it with
51a reference to the variable you want the size of. If you pass in a
52plain scalar it returns the size of that scalar. (Just be careful if
53you're asking for the size of a reference, as it'll follow the
54reference if you don't reference it first)
55
56=head2 EXPORT
57
58None by default.
59
60=head1 BUGS
61
62Only does plain scalars and arrays. No sizes for hashes, globs, code refs, or magic scalars. Yet.
63
64Also, this module currently only returns the size used by the variable
65itself, E<not> the contents of arrays or hashes, nor does it follow
66references past one level. That's for later.
67
68=head1 AUTHOR
69
70Dan Sugalski dan@sidhe.org
71
72=head1 SEE ALSO
73
74perl(1).
75
76=cut