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"], }, }
In reply to Problem: Lazy Hash Evaluation by adriani
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |