From: snacktime Date: 2006-08-13T11:32:07+09:00 Subject: Re: perl tr and ruby String#tr Ok almost there one more question on using tr. If the to_string is a variable, what to do? In perl you would use eval because the transliteration for the from_string and to_string are done at compile time. Following is the perl code that produces the correct result, and the ruby code which I can't get to produce the same output. Any ideas on how to do this correctly in ruby? $even_parity = '\0\201\202\3\204\5\6\207\210\11\12\213\14\215\216\17\220\21\22\223\24\225\226\27\30\231\232\33\234\35\36\237\240\41\42\243\44\ 245\246\47\50\251\252\53\254\55\56\2570\261\2623\26456\267\2709\72\273\74\275\276\77\300AB\303D\305\306GH\311\312K\314MN\317P\321\322S\324UV\3 27\330YZ\333\134\335\336_\140\341\342c\344ef\347\350ij\353l\355\356o\360qr\363t\365\366wx\371\372\173\374\175\176\377\0\201\202\3\204\5\6\207\ 210\11\12\213\14\215\216\17\220\21\22\223\24\225\226\27\30\231\232\33\234\35\36\237\240\41\42\243\44\245\246\47\50\251\252\53\254\55\56\2570\2 61\2623\26456\267\2709\72\273\74\275\276\77\300AB\303D\305\306GH\311\312K\314MN\317P\321\322S\324UV\327\330YZ\333\134\335\336_\140\341\342c\34 4ef\347\350ij\353l\355\356o\360qr\363t\365\366wx\371\372\173\374\175\176\377'; eval <