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

Support both `!perl/...` and `!!perl/...` tags #11

Closed
perlpunk opened this issue Apr 10, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@perlpunk
Copy link
Owner

commented Apr 10, 2019

The current behaviour of existing perl modules:

Dump:

# my $object = bless {}, "Foo";
# YAML.pm
--- !!perl/hash:Foo {}
# YAML::XS
--- !!perl/hash:Foo {}
# YAML::Syck
--- !!perl/hash:Foo {}

Load:

# --- !perl/hash:Foo {}
# YAML::Syck
Foo=HASH(0x556c4af24858)
# YAML.pm
Foo=HASH(0x556c4af24858)
# YAML::XS
perl/hash:Foo=HASH(0x564a5359d360)

# --- !!perl/hash:Foo {}
# YAML::Syck
Foo=HASH(0x556c4af2f4b8)
# YAML.pm
Foo=HASH(0x556c4af2f4b8)
# YAML::XS
Foo=HASH(0x564a5359d858)

So all modules use two exclamation marks when dumping.
YAML.pm and YAML::Syck support both variants when loading, YAML::XS only supports two exclamation marks.

The recommendation of the YAML spec as I understand it is to use one exclamation mark.
Two exclamation marks are reserved for standard YAML tags.

To let YAML::PP interact with the other YAML modules, it needs to support both.

@perlpunk perlpunk changed the title Support both `!perl/...` and `!!perl...` tags Support both `!perl/...` and `!!perl/...` tags Apr 10, 2019

@perlpunk

This comment has been minimized.

Copy link
Owner Author

commented Apr 26, 2019

Implemented in 837f15a

@perlpunk perlpunk closed this Apr 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.