eff_i_g has asked for the wisdom of the Perl Monks concerning the following question:
Therefore, Data::Dumper is loaded when debugging, and a simple "x $stack->();" shows all 3 stacks.require Data::Dumper if $^P; #...lots of code... my %output; ### The information that was output last my %current; ### The current record's information my %previous; ### The previous record's information ### Now that these variables are in scope, create a closure ### that we can use for debugging. This prints all 3 stacks. my $stack = sub { print Data::Dumper->Dump( [\%previous, \%output, \%current], ['*previous', '*output', '*current'] ); };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wide open Closures?
by dave_the_m (Monsignor) on Dec 02, 2005 at 17:49 UTC | |
by eff_i_g (Curate) on Dec 02, 2005 at 18:10 UTC | |
|
Re: Wide open Closures?
by samtregar (Abbot) on Dec 02, 2005 at 17:54 UTC | |
by eff_i_g (Curate) on Dec 02, 2005 at 18:21 UTC | |
|
Re: Wide open Closures?
by revdiablo (Prior) on Dec 02, 2005 at 17:50 UTC | |
by eff_i_g (Curate) on Dec 02, 2005 at 18:15 UTC |