I am trying to use tr to do a binned replacement of a bunch of characters ASCII 33-126 where I bin the replacements as 33-42, 43-52, 53-62 and >62 and rename them 0, 1, 2, and 3.
I have tried all combinations (but not the right one) to affect this and seem to get at best replacement of all values to 3. Here are a few iterations:
###$quality =~ tr /[!"#$%&'()*][+,-./01234][56789:;<=>][?@ABCDEFGHIJKL +MNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~]/0123/; ###$quality =~ tr /[\!-\*][\+-4][5-\>][\?-\~]/0123/; ###$quality =~ tr/[\x21-\x2a][\x2b-4][5-\x3e][\x3f-\x78]/0 +123/; ###$quality =~ tr/[\x21-\x2a][\x2b-\x34][\x35-\x3e][\x3f-\ +x78]/0123/; ###$quality =~ tr/[\!-\*][\+-4][5-\>][\?-\~]/0123/;
Any suggestions?
Thanks,
Bob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |