Devel::FindGlobals
This module finds all your globals and prints out their sizes (thanks to Devel::Size). Here's an example of its use. It can also return the data as a hashref instead of printing it. Is it worth putting on the CPAN?
[pudge@bourque Data]$ perl -MDevel::FindGlobals -wle 'print print_globals_sizes(exclude_match => [qw(warnings overload VERSION$ EXPORT(_\w+)?$ Exporter Carp DynaLoader)])'
Name of SCALAR variable Size Total Size
============================================ ====================================
$main::%08 96 96
$main::%0F 103 103
$main::%16 41 41
$main::%17 96 96
$main::%17ARNING_BITS 96 96
$main::%18 29 29
$main::! 96 96
$main::" 26 26
$main::$ 16 16
$main::+ 96 96
$main::- 96 96
$main::/ 98 98
$main::0 99 99
$main::1 96 96
$main::@ 264 264
$main::] 43 43
Name of ARRAY variable Size Total Size
============================================ ====================================
@DB::args 56 56
@main::+ 108 108
@main::- 108 108
@main::ARGV 56 56
@main::INC 100 419
@main::_ 68 437
Name of HASH variable Size Total Size
============================================ ====================================
%Config::Con fig 144 144
%main::@ 92 92
%main::ENV 1175 4824
%main::INC 540 1345
%main::SIG 1255 4424
Now Playing: It's Nice To Be With You - The Monkees (The Monkees Greatest Hits)
Leave a comment