in reply to Re^2: char substitution without regexes
in thread char substitution without regexes

It passes a pattern, but it's actually special-cased not to use the regex engine.

Ok, so I did it without thinking.

print map $complement{$_}, reverse unpack '(a)*', $chain;

Replies are listed 'Best First'.
Re^4: char substitution without regexes
by jwkrahn (Abbot) on Sep 30, 2010 at 18:16 UTC

    Now you've got it!   :-)

    By the way, which do you think would be more efficient, reversing the list, or reversing the string first?

      Reversing an array of SV* or reversing an array of char (assuming UTF8=0)? We're talking about the same CPU ops.