Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[erix]: This sad, embarrassing wreck of a man

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2018-07-17 21:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (378 votes). Check out past polls.

    Notices?