Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: return of assigment in list context (bug?)

by dsheroh (Parson)
on Jan 02, 2013 at 14:03 UTC ( #1011276=note: print w/ replies, xml ) Need Help??


in reply to return of hash-assigment in list context (bug?)

What version of perl are you using? With my

This is perl 5, version 14, subversion 2 (v5.14.2) built for i686-linu +x-gnu-thread-multi-64int
I get the results that I would expect, with no duplicated values:
$ perl %h1=(a=>1,b=>2); %h2=(a=>11,c=>3); print (%h3=(%h1,%h2),"\n"); print %h3, "\n"; a11b2c3 c3a11b2


Comment on Re: return of assigment in list context (bug?)
Select or Download Code
Re^2: return of assigment in list context (bug!)
by LanX (Canon) on Jan 02, 2013 at 14:06 UTC
    This is perl, v5.10.0 built for i486-linux-gnu-thread-multi

    Thanks a lot... so it's an already fixed bug and I can stop chasing my faults! :)

    Cheers Rolf

      It appears to have been fixed between 5.12 and 5.14, though nothing is noted in perl5140delta.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
        Thanks!

        I browsed thru various perldelta513* w/o spotting it.

        For those interested here a one-liner for testing your perl-version:

        lanx@nc10-ubuntu:~$ perl -e '@k=( %h=(a=>42,b=>2,a=>1) ); print "$] Bu +g: @k\n" unless @k ~~ [%h]' 5.010000 Bug: b 2 b 2

        I'll gonna update a non-smartmatch solution here...

        UPDATE:

        w/o smart-match for even older perl versions (maybe the bug was introduced somewhere)

        lanx@nc10-ubuntu:~$ perl -e '%h2=@k=( %h=(a=>42,b=>2,a=>1) ); delete @ +h{keys %h2}; print "$] Bug: @k\n" if %h' 5.010000 Bug: b 2 b 2

        Cheers Rolf

        UPDATE: replace version-vars s'$^V'$]'g in code-sections

Re^2: return of assigment in list context (bug?)
by perl514 (Pilgrim) on Jan 02, 2013 at 18:24 UTC

    Hi

    Kindly let me know which OS you are using

    Perlpetually Indebted To PerlMonks

    Win 7 at Work. Living through it....Linux at home. Loving it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011276]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-07-04 02:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls