in reply to Re: YAML::XS perl/regexp (?u:(?u:
in thread YAML::XS perl/regexp (?u:(?u:

YAML should store the pattern (( re::regexp_pattern($re) )[0] ) and the modifiers ( ( re::regexp_pattern($re) )[1] ) separately.

...and YAML::XS should make use of XS(XS_re_regexp_pattern) in universal.c to achieve that. Inevitably, this raises backcompat issues.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re^3: YAML::XS perl/regexp (?u:(?u:
by ikegami (Patriarch) on Dec 07, 2017 at 22:45 UTC

    and YAML::XS should make use of XS(XS_re_regexp_pattern) in universal.c

    And how does one do that? XS(XS_re_regexp_pattern) creates the Perl sub re::regexp_pattern, so that's a very weird way of saying that YAML::XS should call Perl sub re::regexp_pattern.

    Inevitably, this raises backcompat issues.

    This can be addressed by storing them as a different type than perl/regexp (perl/regexp_plus_mods?).

      i think shmem was talking about regexp_pattern only available since perl 5.10, while YAML and YAML::XS aim to spport 5.8. I wonder how your suggeestion addresses that. Can you elaborate or did you mean something else?

        One can always fall back to the current method in older versions of Perl if the guts of the aforementioned sub can't be backported.