It might be handy and orthogonal to implement my as a function, but I dare to question this design decision.
I can't possibly imagine any use of calling my in scalar context, since the list must be statically fixed at compile time.
Furthermore it's not intuitive, if shortening the number of my's result in these side effects. I searched for an hour to find the problem...
Perl already has the disadvantage to default to global vars while other languages automatically restrict to a local scope without extra operator...
... one shouldn't be punished for trying to economize keystrokes!
Anyway it's too late... but IMHO at least a warning should be emitted when using a my(LIST) in scalar context.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.