0xbeef has asked for the wisdom of the Perl Monks concerning the following question:
use Devel::GC::Helper; my $leaks = Devel::GC::Helper::sweep; my $cnt = 0; for my $leak (@$leaks) { print "Leaked $leak\n"; print "detail: [@$leak]\n" if ($cnt); $cnt++; }
which gives
Leaked CODE(0x81f6e8c) Leaked ARRAY(0x81f6e98) Use of uninitialized value in join or string at eyemod.pm line 196. Use of uninitialized value in join or string at eyemod.pm line 196. detail: [ ] Leaked ARRAY(0x81f6ea4) Use of uninitialized value in join or string at eyemod.pm line 196. Use of uninitialized value in join or string at eyemod.pm line 196. Use of uninitialized value in join or string at eyemod.pm line 196. Use of uninitialized value in join or string at eyemod.pm line 196. Use of uninitialized value in join or string at eyemod.pm line 196. detail: [ ] Leaked ARRAY(0x81f6ed4) Use of uninitialized value in join or string at eyemod.pm line 196. detail: [ eyemod.pm eyemod import] Leaked ARRAY(0x8148be0) detail: [] Leaked ARRAY(0x8149708) detail: []
The detail is an effort on my side to show the content of the array in question, since I'm to dumb to translate ARRAY(0x8149708) into an array name. I'm too dumb to understand how to use perl -d for this. ;)
Does anyone perhaps know if I should be concerned about the Leaked warnings?
Secondly, does anyone know of a method to track down unused variables in large perl scripts, without the manual rigmarole? My searches lead me to perl_checker, but this seems to be intended for Mandriva.
Niel
Replies are listed 'Best First'. | |
---|---|
Re: Devel::GC::Helper and unused variables
by Anonymous Monk on Feb 26, 2007 at 22:34 UTC | |
by 0xbeef (Hermit) on Feb 27, 2007 at 05:44 UTC | |
Re: Devel::GC::Helper and unused variables
by bobf (Monsignor) on Feb 27, 2007 at 06:13 UTC | |
by 0xbeef (Hermit) on Feb 27, 2007 at 21:59 UTC |