Skip to content

PATCH: duplicate reference trips up rmap #6

Description

@FGasper
use strict;
use warnings;

use Data::Rmap;

my $href = [];

my $struct = {
    foo => $href,
    bar => $href,
};

rmap_all { $_ = 123 if 'ARRAY' eq ref } $struct;

use Data::Dumper;
print Dumper $struct;

The above should convert both $struct values to 123, but it only does one of them. This appears to be because the “seen” hash is populated before the coderef rather than after it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions