I see. I would expect the strings coming in to contain the characters to operate on, not strings that Perl can turn into the characters to operate on by evaluating them.

The \b is tricky, as I can use it to get three different results from my three subroutines:

# Add this to the list of cases: [ "a\b\\b" => '\\/', 'xy', "a\bxb"] # Results: not ok 22 - simulate # Failed test 'simulate' # at ./2.pl line 64. # got: 'xb' # expected: 'xb' ok 23 - cheat Replacement list is longer than search list at (eval 45) line 1. not ok 24 - use # Failed test 'use' # at ./2.pl line 66. # got: '\b' # expected: 'xb'

Switching to Test2::V0 explains the test 22:

not ok 22 - simulate # Failed test 'simulate' # at ./2.pl line 64. # +-------+----+-------+ # | GOT | OP | CHECK | # +-------+----+-------+ # | a\bxb | eq | xb | # +-------+----+-------+

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

In reply to Re^6: Transform ASCII into UniCode (escape_metas) by choroba
in thread Transform ASCII into UniCode by Perlian

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.