Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How to assign an array to a value in hash?

by matija (Priest)
on Apr 22, 2004 at 12:00 UTC ( #347314=note: print w/replies, xml ) Need Help??


in reply to How to assign an array to a value in hash?

When you say $new_hash{$some_key1} = @some_array1; you are assigning to a scalar. Try
@{$new_hash{$some_key1}} = @some_array1; # extra {} are for clarity

Of course, you will need to change the @value_array assignement:

my @value_array = @{$new_hash{$_}};

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-01-29 03:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?