It works with pure-perl but not YAML::XS

#!/usr/bin/perl -- use strict; use warnings; print qr{yo}usim, "\n"; $::yo++; print qr{yo}usim, "\n"; $::yo--; use YAML::XS; print YAML::XS::Dump( [ qr{yo}usim ] ), "\n"; package Regexp; use Data::Dump; sub ixsm { #~ (?s-xim:s) my( $i )=@_; my %onoff = ( qw/ s 0 i 0 m 0 x 0 / ); $onoff{$1}++ while $i =~ /(.)/g;; delete $onoff{$_} for qw/ o a l u d /; my @off; my @on; while( my($k,$v) = each %onoff ){ push @on, $k if $v; push @off, $k if not $v; } my $on = join'',@on; my $off = join'',@off; my $ret = "(?$on"; $ret .="-$off" if length $off; $ret; } use overload '""' => sub { my( $self_operand_overloaded, $other_operand, $other_operand_was_o +n_the_left_side ) = @_; my( $patt, $mods ) = re::regexp_pattern( $self_operand_overloaded +); $::yo and return ixsm($mods).':'.$patt.')'; ## oldstyle return $self_operand_overloaded; ## modern }; __END__ (?^umsi:yo) (?msi-x:yo) --- - !!perl/regexp (?^umsi:yo)
Seems YAML::XS doesn't process overloads, peeks inside like Devel::Peek

In reply to Re^2: YAML: regex stringification has changed (bless/overload not YAML::XS) by Anonymous Monk
in thread YAML: regex stringification has changed by Boldra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.