ingydotnet / yaml-libyaml-pm

Perl Binding to libyaml
http://search.cpan.org/dist/YAML-LibYAML/
33 stars 37 forks source link

Regex serialization could be improved #72

Open perlpunk opened 6 years ago

perlpunk commented 6 years ago

See https://github.com/ingydotnet/yaml-libyaml-pm/issues/69 and http://perlmonks.org/?node_id=1204940 ikegami suggests using re::regexp_pattern(). re is in core since perl 5.004, the function was added in perl 5.10. When Dumping, we could look if there are any regex flags other than u, and if not, store the naked pattern, otherwise store the stringified regex. For perl 5.8, we would just go with the existing code.