Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Merge hashrefs into one

by LanX (Saint)
on Jul 14, 2020 at 16:19 UTC ( [id://11119308]=note: print w/replies, xml ) Need Help??


in reply to Merge hashrefs into one

var1-3 are array (AoH) references, hence scalar and not hashes.

This my ($data) = {$var1, $var2, $var3}; to create a hash doesn't make any sense, the error is correct.

I don't understand what you're desired output is, so please specify.

Try $a_new= [ @$var1, @$var2, @$var3 ]

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119308]
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: (5)
As of 2024-04-23 21:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found