title: negated / inverted character class fails to match square bracket in perl
body: <p>In the syntax below, following <a href="https://perldoc.perl.org/perlrecharclass#Negation" rel="nofollow noreferrer">perldoc</a>,
  I would expect every character not in the Latin 26-letter alphabet to be transformed into underscore <code>_</code>.</p>
  <p>But instead, the square bracket is not recognized as being in this character class, as we see:</p>
  <pre><code>&gt; printf '%s' 'dog[-1]cat' | perl -p -e 'use strict; use warnings; s/[^A-za-z]/_/g;'; echo;
  dog[__]cat
  &gt; perl --version
  
  This is perl 5, version 18, subversion 4 (v5.18.4) built for darwin-thread-multi-2level
  (with 2 registered patches, see perl -V for more detail)
  
  </code></pre>
  <p>To get what I want, I have to <strong>explicitly</strong> mention the square brackets, like this:</p>
  <pre><code>&gt; printf '%s' 'dog[-1]cat' | perl -p -e 'use strict; use warnings; s/[^A-za-z]/_/g; s/[\[\]]/_/g;'; echo;
  dog____cat
  </code></pre>
  <p>The concept of negation/inversion seems simple; what am I missing?</p>
  <p>And is there a more elegant say to achieve what I want, for instance without using two sequential substitutions?</p>