3 Devel::Size - Perl extension for finding the memory usage of Perl variables
7 use Devel::Size qw(size total_size);
9 my $size = size("A string");
11 my @foo = (1, 2, 3, 4, 5);
12 my $other_size = size(\@foo);
14 my $foo = {a => [1, 2, 3],
17 my $total_size = total_size($foo);
21 This module figures out the real size of Perl variables in bytes, as
22 accurately as possible.
24 =head1 Build and Install
26 To build and install this module, you need:
29 a working C or C++ compiler
30 a make (or namke on Windows) utility
34 On Linux, Cygwin, or Unix:
41 On most systems, it is necessary to link to libstdc++. On such systems,
42 libstdc++ should be found automatically (by default).
43 If libstdc++ is *not* being found automatically (in which case you'll get
44 link errors),then instead of running 'perl Makefile.PL', you'll need to run:
46 perl Makefile.pl LIBS="-L/path/to/libstdc++ -lstdc++"
57 Please report bugs to:
59 http://rt.cpan.org/NoAuth/Bugs.html?Dist=Devel-Size
63 Copyright (C) 2005 Dan Sugalski, Copyright (C) 2007-2008 Tels
65 This module is free software; you can redistribute it and/or modify it
66 under the same terms as Perl v5.8.8.