I don't know the answer to your question but I almost always start out on this sort of thing by looking in a few places: grep op_seq *.h (cop.h, embedvar.h, intrpvar.h, op.h, perlapi.h). op.h and cop.h show it as part of the base OP struct. A grep op_seq *.c shows it's only relevant in op.c and sv.c. Inspection of sv.c shows it's not really used there so the entire shebang is restricted to op.c.
op_seq itself is used all over op.c but after a quick scan it looks like it's used for scoping rules. So... relevant to your actual question I'd suggest you take a look at pad_addlex and see how op_seq is being used there. I'd guess that if you're adding lexicals that you just need to add the scope information to NVX/IVX. pad_find(lex/my) shows how your seq information is used. So in general - the source is probably your best reference for this. Maybe someone here actually knows what to set your NVX/IVX values to. [Added NVX is your op_seq value and IVX is PL_seqmax. The difficulty is on how you find the right op_seq value and whether you have to increment PL_seqmax, increment other lexical's op_seq/seqmax values, walk the opcode tree to update their op_seq values... etc. That's why I was hazy.] Addition: Oh yes - the whole point of this node is to demonstrate how it's easy to find these sorts of answers by reading the source. This is what fifteen minutes with grep and less returned - I'm sure that since you already have an environment which gives you access to these variables that it's even easier to verify their operation.
Fun Fun Fun in the Fluffy Chair
|