adriani has asked for the wisdom of the Perl Monks concerning the following question:
However, my test was failing so I added the following lines after generic_rv_test($rv); to start debugging the issue:sub generic_rv_test { my $rv = shift; foreach my $key (keys %$rv) { if (exists($rv->{$key}{used_by})) { # test used_by ... } else { # fail test } } } my $rv = scan_deps( files => ['t/data/pluggable/Foo.pm'], recurse => 1, ); generic_rv_test($rv);
However, adding these lines somehow caused my test to start working! What seems to be happening is that $rv is more complete with the dump lines than without. Can someone explain what is happening? Basically, I want to be able to ensure $rv is contains all it's information before calling the test function on it but without having to dump $rv ...use Data::Dump qw(dump); print dump $rv;
$rv without the dump lines:
$rv with the dump lines:{ "Pluggable.pm" => { file => "C:/Perl/site/lib/Module/Pluggable.pm", key => "Module/Pluggable.pm", type => "module", }, }
Thanks, AdrianI{ "Pluggable.pm" => { file => "C:/Perl/site/lib/Module/Pluggable.pm", key => "Module/Pluggable.pm", type => "module", used_by => ["Foo.pm"], }, }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem: Lazy Hash Evaluation
by diotalevi (Canon) on Feb 25, 2007 at 00:28 UTC | |
by Anonymous Monk on Feb 25, 2007 at 14:17 UTC | |
|
Re: Problem: Lazy Hash Evaluation
by blazar (Canon) on Feb 24, 2007 at 22:40 UTC |