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 In reply to Devel::GC::Helper and unused variables
by 0xbeef
For:
Use:
& & < < > > [ [ ] ]