Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Concerning hash operations (appending, concatenating)

by manav (Scribe)
on Mar 24, 2005 at 16:53 UTC ( #442114=note: print w/replies, xml ) Need Help??


in reply to Concerning hash operations (appending, concatenating)

The above solutions rely on interpreting the hash in a list context, in which it returns all its key value pairs flattened out. for eg, see the below code
use strict ; use warnings ; my %hash=('a'=>'b','c'=>'d') ; my @arr=(%hash) ; local $"="|" ; print "@arr" ;
which spews out
a|b|c|d
Now,
(%hash,'e'=>'f')
flattens out the key value pairs of %hash into a list. Hence it reduces to
('a'=>'b','c'=>'d','e'=>'f')
So on and so forth for code like
(%hash1,%hash2)


Manav

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://442114]
help
Chatterbox?
Discipulus roof? or terrace? well is flat anyway, parallel to the ground
[Eily]: upper ground :P
[marto]: erix [id://1193617| pretty much
[marto]: err pretty much

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-06-29 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (665 votes). Check out past polls.