Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump() should keep aliases for non-ref values #84

Open
perlpunk opened this issue May 14, 2018 · 0 comments
Open

Dump() should keep aliases for non-ref values #84

perlpunk opened this issue May 14, 2018 · 0 comments

Comments

@perlpunk
Copy link
Collaborator

perlpunk commented May 14, 2018

YAML::XS::Load() is able to create aliases for non-ref values when loading.
But when dumping, the alias is lost:

use YAML::XS;
use Data::Dumper;
my $yaml = q/{ x: &alias a, y: *alias }/;
my $data = Load $yaml;
$data->{y} = "b";
say Dumper $data;
say Dump($data);

__END__
$VAR1 = {
          'x' => 'b',
          'y' => ${\$VAR1->{'x'}}
        };

---
x: b
y: b


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant