On 8/24/06, Larry Wall <[EMAIL PROTECTED]> wrote:
On Wed, Aug 23, 2006 at 05:01:43PM -0400, Mark J. Reed wrote:
: Sorry if this is a known question, but I didn't see it mentioned in the
: recent archive or FAQ.
:
: for ($a, $b) { $_ = ... }
:
: gives me a "Can't modify constant item: VRef <Scalar>".

Which is correct as the default.

Not according to the spec.  S04 says:

If you rely on C<$_> as the implicit parameter to a block,
then [it] is considered read/write by default.  That is,
the construct:

    for @foo {...}

is actually short for:

    for @foo -> $_ is rw {...}




--
Mark J. Reed <[EMAIL PROTECTED]>

Reply via email to