in reply to Re: Re: Re: Iterating & Playing with Caller's Pads
in thread Iterating & Playing with Caller's Pads
So how does something for for (@array) { ... } keep track of it's state? Somehow *that* knows where it is. I recall that the hash accessors values/keys alter the hash but the list operators don't appear to do that (I just ran perl -MDevel::Peek -e "@a = qw(hello make my sheep into cherries); for (@a) { Dump(\@a)" to demonstrate to myself that for() doesn't alter the the array anyway. Oh yeah, and these operators also work on lists which don't even have an AV construct so duh, yeah I guess that makes sense. (smacks forehead)
I guess all I can think of is that while(scalar ..) and related's actual OP tracks that. I think what you want to do is use B::Generate to get a handle to a current opcode and then hang the list state off that somewhere... (not that I know if that's even possible, I'm just thinking about this as I type this).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:(5) Iterating & Playing with Caller's Pads
by shotgunefx (Parson) on Sep 27, 2002 at 14:42 UTC | |
by Elian (Parson) on Oct 18, 2002 at 16:23 UTC | |
by shotgunefx (Parson) on Oct 19, 2002 at 09:36 UTC | |
by Elian (Parson) on Oct 21, 2002 at 19:27 UTC |