On Wed 02 Oct 2002 13:50, "H.Merijn Brand" <[EMAIL PROTECTED]> wrote: > As a start for a `normal' interface to the interperters internals, this time > no open hack, but a neat interface. > > Very open to additions. > > Useful? > > Feedback please
Thank you Dan! Devel::Size from Dan Sugalski is what we all want, don't we? =head1 NAME Devel::Size - Perl extension for finding the memory usage of Perl variables =head1 SYNOPSIS use Devel::Size qw(size total_size); my $size = size("A string"); my @foo = (1, 2, 3, 4, 5); my $other_size = size(\@foo); my $foo = {a => [1, 2, 3], b => {a => [1, 3, 4]} }; my $total_size = total_size($foo); =head1 DESCRIPTION This module figures out the real sizes of Perl variables in bytes. Call functions with a reference to the variable you want the size of. If the variable is a plain scalar it returns the size of the scalar. If the variable is a hash or an array, use a reference when calling. -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using perl-5.6.1, 5.8.0 & 633 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3, WinNT 4, Win2K pro & WinCE 2.11. Smoking perl CORE: [EMAIL PROTECTED] http:[EMAIL PROTECTED]/ [EMAIL PROTECTED] send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org