diotalevi has asked for the wisdom of the Perl Monks concerning the following question:

In B::Utils::parent I read that Simon is not sure how to find the parent of nodes where ->seq is false. When does this happen?

sub B::OP::parent { my $target = shift; die "I'm not sure how to do this yet. I'm sure there is a way. If +you know, please email me." if (!$target->seq); ...

Replies are listed 'Best First'.
Re: When is an opcode's ->seq empty?
by diotalevi (Canon) on Jun 14, 2004 at 20:53 UTC

    Some source code reading revealed the answer. I thought that this was a deeper thing than it is. op_seq is zero before the peep-hole optimizer runs on some code and non-zero afterwards as a flag to prevent the optimizer from running again.

    I now wonder how Simon got a handle to some code before the optimizer took hold of it. Hmm...