S5 tr concern

2004-08-27 Thread Aaron Sherman
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',

Re: S5 tr concern

2004-08-27 Thread Luke Palmer
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!

Synopsis 4: Return type of a ~~ b

2004-08-27 Thread Joe Gottman
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 == = ==