Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: generate array of hashes

by jeffa (Bishop)
on Dec 10, 2015 at 21:52 UTC ( #1149941=note: print w/replies, xml ) Need Help??


in reply to [SOLVED] generate array of hashes

You are doing something that we cannot see, the following works just fine:

use strict; use warnings; my %hoh ; my ($dn,$mail) = qw( dn mail ); my @members = qw(foo bar baz); my @email_addrs = qw( foo@here bar@there ); my $rec = { DN => $dn, MAIL => $mail, MEMBERS => [ @members ], PROXYADDRS => [ @email_addrs ], }; $hoh{$dn} = $rec; use Data::Dumper; print Dumper \%hoh;

While it is great to isolate your problem, be sure and post a complete example. It helps with the rubber ducking process. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re^2: generate array of hashes
by stevieb (Abbot) on Dec 10, 2015 at 22:03 UTC
    For completeness... GrandFather pointed this out to me not too long ago (I'm pretty sure of that... If I'm mistaken, I apologize). Rubber duck debugging. We all do it :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2019-07-23 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (27 votes). Check out past polls.

    Notices?