in reply to Re: foreach funny business
in thread foreach funny business

Running your #2 on my perl does not die, and mine claims to be 5.8.8. Are you sure you're on your rocker? :-)

Anyway, to my way of thinking the shift() shouldn't be giving you anything other than _exactly_ what was in $_[0], not some copy.

Now who's with me? /me hoists pitchfork and torch

Replies are listed 'Best First'.
Re^3: foreach funny business
by shmem (Chancellor) on Jun 29, 2006 at 20:34 UTC
    I'm with you, you're right, I'm not. And then, again you're right - 5.8.8 doesn't die, I copied from the wrong shell, and shift() should just pass $_[0], not a copy, unless somebody made shift ro-aware. Have to look after this...

    Mhm. Scanning perldelta... nothing. Then, it's a bug. Or it's just undefined behaviour?

    But hey, it's a clever one. It's like, say, putting your hand in the band-saw, and get a finger cut, but then you draw out your hand and it's ok because it's read-only. One finger extra ;-)

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}