I didn't understand why the results would be different when printing out $string1 and $string2 in below script. I thought the 'tr' operator would work the same way on both strings. Please help! The result from printing $string1: "b b b." The result from printing $string2: " ."
#!/usr/bin/perl $string1 = 'the cat sat on the mat.'; $string1 =~ tr/a-z/b/d; print "$string1\n"; $string2 = 'the cit sit on the mit.'; $string2 =~ tr/a-z/b/d; print "$string2\n";
In reply to transliterate on regex by vicearl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |