In S5, the following is stated:
The tr/// quote-like operator now also has a subroutine form.
* It can be given either a single PAIR:
$str =~ tr( 'A-C' = 'a-c' );
* Or a hash (or hash ref):
$str =~ tr( {'A'='a', 'B'='b',
Aaron Sherman writes:
Specifically, hashes do not maintain ordering, so a program like this:
$downcaserule = 'A-Z' = 'a-z';
$l33trule = 'EISTA' = '31574';
$str =~ tr( { $l33trule, $downcaserule } );
may or may not do what the naive reader expects, and randomly so!
I just reread the table of smart matches in Synopsis 4, and I realized
that it doesn't say what is returned by a ~~ b. For example, the first line
of this table says
$_ $xType of Match ImpliedMatching Code
== = ==