note
AnomalousMonk
<p>
A note on usage. The <c>tr///</C> operator does not have <c>[...]</C> character classes like regexes (as might be used in <c>s///</C>), but only ranges, e.g., <c>a-z</C>, so the <c>\[ [ ]</C> sequences in the <c>tr/\[A-Z]/[a-z]/</C> expression in the [id://11136476|OP] represent literal <c>[ ]</C> characters (see [href://https://perldoc.pl/perlop#tr/SEARCHLIST/REPLACEMENTLIST/cdsr|tr///] in [href://https://perldoc.pl/perlop#Quote-Like-Operators|Quote-Like Operators] in [doc://perlop]).
</P>
<p>
So <c>'['</C> is being translated to <c>'['</C> and <c>']'</C> to <c>']'</C>. This does no harm (indeed, the <c>tr///</C> compiler may optimize this away), but suggests a misunderstanding of <c>tr///</C>.
</P>
<p>
And since the <c>tr///</C> is just translating upper case to lower, a simple <br>
<c> $_ = lc;</C> <br>
statement might be clearer, hence better (see [doc://lc]).
</P>
<p>
<b>Update:</B> I see now that [Marshall] has already made this point at the end of [id://11136493|this] post.
</P>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-634253">
<hr><p>Give a man a fish<b>:</B> <c> <%-{-{-{-<</C></P>
</div></div>
11136476
11136476