title: How should I use the "my" keyword in Perl?
body: <p>I keep seeing the "my" keyword in front of variable names in example Perl scripts online but I have no idea what it means.  I tried reading the manual pages and other sites online but I'm having difficulty discerning what it is for given the difference between how I see it used and the manual.  </p>
  
  <p>For example, its used to get the length of the array in this post:
  <a href="https://stackoverflow.com/questions/7406807/find-size-of-array-in-perl">Find size of an array in Perl</a></p>
  
  <p>But the manual says:</p>
  
  <blockquote>
    <p>A my declares the listed variables to be local (lexically) to the
    enclosing block, file, or eval. If more than one value is listed, the
    list must be placed in parentheses.</p>
  </blockquote>
  
  <p>What does it do and how is it used? </p>