It's more than that. my() even counts as (my) at the grammar level.

Aside from their use of overriding precedence, their use in flow control statements, and their use in function prototypes and parameter lists, parens are syntactically significant in five places:

$x = 4; # Scalar assignment operator (sassign) ($x) = 4; # List assignment operator (aassign) $x x 4 # String repetition operator (repeat) ($x) x 4 # Scalar repetition operator (repeat/DOLIST) \$x, $y # The referencing isn't distributed. \($x, $y) # The referencing is distributed. use Mod; # Calls import. use Mod (); # Doesn't call import. @a = ; # Illegal @a = (); # Stub operator

my ($x, $y) is considered the same as (my $x, my $y) in all five of those circumstances.

my ($x) = 4; # Same as: (my $x) = 4; my ($x) x 4 # Same as: (my $x) x 4 \my ($x, $y) # Same as: \(my $x, my $y) use Mod my(); # Same as: use Mod (); @a = my(); # Same as: @a = ();

In reply to Re^2: my within brackets by ikegami
in thread my within brackets by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.