Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Concerning hash operations (appending, concatenating)

by manav (Scribe)
on Mar 24, 2005 at 16:53 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://442114]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-25 11:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found