I found this example in a Perl tutorial, but could not understand the output. The tutorial says:
The /d modifier deletes the characters matching SEARCHLIST that do not have a corresponding entry in REPLACEMENTLIST.
but I could not figure out how this is realized in the example.
Can somebody explain how the output was generated?
Script:
$string = 'the cat sat on the mat.';
$string =~ tr/a-z/b/d;
print "[$string]\n";
Output:
[ b b b.]
(The square brackets mark the start and end of the string, that's all.)