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

Load("{a}: b") #31

Open
pipcet opened this issue Apr 21, 2015 · 1 comment
Open

Load("{a}: b") #31

pipcet opened this issue Apr 21, 2015 · 1 comment

Comments

@pipcet
Copy link

pipcet commented Apr 21, 2015

(I hope I'm testing this with the right source code. Please ignore it if it's not reproducible.)

This isn't a major problem, but I was a little surprised to see

perl -MYAML::XS -MData::Dumper -e 'warn Dumper Load("{a}: b")'

produce

$VAR1 = {
          'HASH(0x76cb88)' => 'b'
        };

(note that HASH(0x76cb88) is a string, and in fact the actual hash has been destroyed at this point) rather than warning or croaking on the input. It would be nice to have the option of parsing such data as an alternating sequence (but that would make actual sequences less nice as they'd turn into [0, x, 1, y, 2, z]-style alternating sequences), I think.

@guest20
Copy link

guest20 commented Jul 31, 2018

Alternate suggestions:

  • tie hashes with non-string keys
  • An additional hash that maps from the stringification to the original ref
  • Update the docs to suggestion Acme::Ref ;)

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

2 participants