Subject: | $Data::Walk::{container,type} wrong if bydepth=>1 is set |
The following script:
#!perl
use strict;
use Data::Walk;
my $data = {foo => "bar"};
walk +{
wanted => sub { print "!bydepth: <$Data::Walk::container>
<$Data::Walk::type> <$_>\n" },
}, $data;
print "\n";
walk +{
wanted => sub { print "bydepth: <$Data::Walk::container>
<$Data::Walk::type> <$_>\n" },
bydepth => 1,
}, $data;
print "\n";
__END__
has the following output:
!bydepth: <> <> <HASH(0x81ed158)>
!bydepth: <HASH(0x81ed158)> <HASH> <foo>
!bydepth: <HASH(0x81ed158)> <HASH> <bar>
bydepth: <foo> <> <foo>
bydepth: <bar> <> <bar>
bydepth: <HASH(0x81ed158)> <HASH> <HASH(0x81ed158)>
In the non-bydepth case, the $Data::Walk::container and
$Data::Walk::type are as expected. But in the bydepth case it seems to
be wrong.
Regards,
Slaven