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