note
ikegami
<blockquote><p><i>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</i></blockquote>
<p>That's not how context works at all, but even if you only consider list context, you still have:
<ul>
<li><c>@{ ... }</c> evaluates to an array or a list.
<li><c>@{ ... }[1,2]</c> evaluates to a list.
<li><c>%{ ... }[1,2]</c> evaluates to a list.
<li><c>%{ ... }</c> evaluates to a hash or a list.
<li><c>*{ ... }</c> returns a scalar (glob).
<li><c>*{ ... }{ARRAY}</c> returns a scalar (reference).
<li><c>&{ ... }</c> can evaluate to a list or a scalar.
<li><c>${ ... }->()</c> can evaluate to a list or a scalar.
</ul>
<p>so in list context,
<ul>
<li><c>@...</c> can evaluate to an array or a list.
<li><c>%...</c> can evaluate to an hash or a list.
<li><c>$...</c> can evaluate to a list or a scalar.
<li><c>&...</c> can evaluate to a list or a scalar.
<li><c>*...</c> can evaluate to a glob or a reference.
</ul>
<blockquote><p><i>Of course they do, at least since perl4 patchlevel 36 (or 19 on Atari).</i></blockquote>
<p>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.
<blockquote><p><i>the evaluation of an identifier bare of any context depends on its sigil.</i></blockquote>
<p>Noone said otherwise. Of course it depends on the sigil. @a is not the same as $a.
<p>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.
1064016
1065007