Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: join two hashes

by persianswallow (Novice)
on Jul 30, 2011 at 11:38 UTC ( [id://917612]=note: print w/replies, xml ) Need Help??


in reply to join two hashes

i am beginner but i did it as this code

my @key=keys %rep; for my $key(@key){ $new_hash{$key}="[$rep{$key},$comb{$key}]";}

please professionals tell me is it correct or not.

Replies are listed 'Best First'.
Re^2: join two hashes
by Anonymous Monk on Jul 30, 2011 at 11:51 UTC
    Well, it doesn't accomplish your stated goal, storing two values for one key, which is accomplished by storing an array reference

    What this does is store one value, a scalar, a string

    If this is what you want, then it is correct :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-26 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found