The result of the evaluation of an identifier with its sigil may be coerced to something diferent depending on the context in which that evaluation is effective
That's not how context works at all, but even if you only consider list context, you still have:
- @{ ... } evaluates to an array or a list.
- @{ ... }[1,2] evaluates to a list.
- %{ ... }[1,2] evaluates to a list.
- %{ ... } evaluates to a hash or a list.
- *{ ... } returns a scalar (glob).
- *{ ... }{ARRAY} returns a scalar (reference).
- &{ ... } can evaluate to a list or a scalar.
- ${ ... }->() can evaluate to a list or a scalar.
so in list context,
- @... can evaluate to an array or a list.
- %... can evaluate to an hash or a list.
- $... can evaluate to a list or a scalar.
- &... can evaluate to a list or a scalar.
- *... can evaluate to a glob or a reference.
Of course they do, at least since perl4 patchlevel 36 (or 19 on Atari).
I can't verify that claim, but I doubt it. At the very least, it hasn't been the case since 5.6 which was released 14 years ago. There is not a single sigil that indicates the type of the value returned.
the evaluation of an identifier bare of any context depends on its sigil.
Noone said otherwise. Of course it depends on the sigil. @a is not the same as $a.
The premise demerphq put forth is that the sigil is an indicator of the type of value to which the sigiled expression evaluates to. That's clearly not the case. You can't break a model that doesn't exist.
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.