10 our @ISA = qw(Exporter DynaLoader);
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.
16 # This allows declaration use Devel::Size ':all';
17 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
19 our %EXPORT_TAGS = ( 'all' => [ qw(
23 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
28 our $VERSION = '0.01';
30 bootstrap Devel::Size $VERSION;
32 # Preloaded methods go here.
36 # Below is stub documentation for your module. You better edit it!
40 Devel::Size - Perl extension for finding the memory usage of perl variables
44 use Devel::Size qw(size);
45 $size = size("abcde");
46 $other_size = size(\@foo);
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)
62 Only does plain scalars and arrays. No sizes for hashes, globs, code refs, or magic scalars. Yet.
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.
70 Dan Sugalski dan@sidhe.org