Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Convert string to hash

by AppleFritter (Vicar)
on Mar 27, 2017 at 17:41 UTC ( [id://1186104]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Convert string to hash
in thread Convert string to hash

how can i make this work (dont work)

Individual hash (and array) elements must be scalars. In order to store a more complex data structure, you have to store a reference — which is what $value already is. So assuming that this is what you want to do, and assuming %temp was previously declared as a hash,

$certname = $value->{'certname'}; $temp{$certname} = $value;

should do the trick.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (None)
    As of 2024-04-25 01:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found