Show quoted text> Can you check whether this works for you:
> - $copy->addNoRealize($_->clone) foreach $self->orderedFields(@_);
> + $copy->addNoRealize($_->clone) foreach $self->grepNames(@_);
You probably mean this (orderedFields takes no args anyway):
- $copy->addNoRealize($_->clone) foreach $self->orderedFields;
+ $copy->addNoRealize($_->clone) foreach $self->grepNames(@_);
At least that's what my copy looks like. That patch works for me in my
test case that I used to confirm the problem, but not in my original
program where I experienced the problem.
I looked into this a bit. The sub grepNames() (line 133) will not
return a list of blessed refs, but a list of scalars iff it exits at
line 138, i.e. when you didn't pass it any arguments. I understand
that this is an optimization: If you grepNames for nothing, it returns
everything. However the expression $_->clone (line 20, modified by
patch) won't work if $_ is a scalar.
I'm not sure about this as I don't know all that code well, but maybe
grepNames is meant to return $self->orderedFields instead of $self-
Show quoted text>names when it's not given any arguments.