note
Fletch
<p>
The undef <c>$_++</c> vs <c>$$_++</c> I think the former is working because what's happening is:
</p>
<ul>
<li>An <c>SVrv</c> pointing to the <c>SV*</c> for undef is pushed on the arg stack</li>
<li>When <c>map</c> calls the EXPR <c>$_++</c> that reference is getting numified, incremented, and that new int value stuck back into the <c>SV*</c> on the arg stack</li>
<li>Since it's a postincrement the map is returning the original value of <c>$_</c> which is the ref to undef</li>
<li>The call stack goes away and with it the <c>SV*</c> which had the numified address plus one.
</ul>
<p>
In the second case you're explicitly dereferencing the <c>SVrv</c> to the constant <c>undef</c> and trying to increment <em>that</em> (which fails because <c>undef</c> is a singleton readonly <c>SV*</c>).
</p>
<p>
<b>Edit:</b> And again yes making explanation by way of the implementation, but I think that's because knowing (sort of) how this is implemented under the covers makes these particular corner cases' behaviors not (as) surprising.
</p>
<div class="pmsig"><div class="pmsig-58196">
<p>
The cake is a lie.<br />
The cake is a lie.<br />
The cake is a lie.<br />
</p>
</div></div>
11120285
11120360