On 6 Oct 2004, at 19:11, Rick Delaney wrote:

On Wed, Oct 06, 2004 at 06:58:58PM +0100, Graham Barr wrote:

But reading the code it seems to me that the code above would not do what the user expected anyway. The code in pp_aassign looks like it is trying to do the same thing regardless of the LHS being an array or a hash. So it would seem the stack would have the same contents as the RHS and not whats left after the hash assignment had removed duplicates.

It looks like it's trying to treat arrays and hashes differently to me, in particular note the comment:

        /* Removes from the stack the entries which ended up as
         * duplicated keys in the hash (fix for [perl #24380]) */

Yes, you are right. I was looking at old source.

But the code seems flawed. It counts duplicates during the assignment loop.
Then at the end does a single move on the stack. The move should happen
during assignment loop.


Graham.



Reply via email to