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]) */

Maybe that fix just didn't have enough test cases.  As for what it
should do, I just found in perlop

       Similarly, a list assignment in list context produces the
       list of lvalues assigned to, and a list assignment in
       scalar context returns the number of elements produced by
       the expression on the right hand side of the assignment.

So I think Boris's code should do what he expected.

-- 
Rick Delaney
[EMAIL PROTECTED]

Reply via email to