Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^4: return of assigment in list context (one-liner for testing)

by LanX (Chancellor)
on Jan 02, 2013 at 16:24 UTC ( #1011308=note: print w/ replies, xml ) Need Help??

in reply to Re^3: return of assigment in list context (bug!)
in thread return of hash-assigment in list context (bug?)


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...


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

Comment on Re^4: return of assigment in list context (one-liner for testing)
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2015-11-30 01:54 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (756 votes), past polls