![]() |
|
Perl Monk, Perl Meditation | |
PerlMonks |
RE: strange looking codeby BlaisePascal (Monk) |
on Oct 20, 2000 at 18:11 UTC ( #37665=note: print w/replies, xml ) | Need Help?? |
It looks perfectly understandable to me...
%r ends up having the keys (a,b,c,d,e,f,g,h,i,j) and their respective values (A,B,C,D,E,F,G,H,I,J) The line @A{keys %r} = keys %r; causes %A to have the keys (a,b,c,d,e,f,g,h,i,j) and the respective values (a,b,c,d,e,f,g,h,i,j). In the final line, print %A, "\n";, %A is being used in a list context, and thus looks like a list of key-value pairs, like so: (a,a,b,b,c,c,d,d,e,e,f,f,g,g,h,h,i,i,j,j), which gets printed out with no delimiters between each element as aabbccddeeffgghhiijj, which is what you saw. That help?
In Section
Seekers of Perl Wisdom
|
|