Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Convert string to hash

by AppleFritter (Vicar)
on Mar 27, 2017 at 17:41 UTC ( #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? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2021-10-22 17:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?