Re: HoA question
- From: cajun@xxxxxxxxxxxx ("M. Lewis")
- Date: Thu, 28 Dec 2006 22:29:12 -0500
John W. Krahn wrote:
my %HoH;
while (my $line = <DATA>){
chomp $line;
my ($prod, $flavor) = split ' ', $line, 2;
$HoH{ $prod }{ $flavor } = ();
}
for my $i ( keys %HoH ) {
print "$i -- @{[ keys %{$HoH{$i}} ]}\n";
}
Does it matter that the value of the HoH is undef?
jelly -- strawberry apple grape pear
jam -- strawberry apple grape
milk -- plain strawberry chocolate
$HoH = {
'jelly' => {
'strawberry' => undef,
'apple' => undef,
'grape' => undef,
'pear' => undef
},
'jam' => {
'strawberry' => undef,
'apple' => undef,
'grape' => undef
},
'milk' => {
'plain' => undef,
'strawberry' => undef,
'chocolate' => undef
}
};
--
IBM: Inshallah Burak Ma'lesh
22:25:01 up 14 days, 19:16, 0 users, load average: 0.46, 0.41, 0.37
Linux Registered User #241685 http://counter.li.org
.
- Follow-Ups:
- Re: HoA question
- From: John W. Krahn
- Re: HoA question
- References:
- HoA question
- From: "M. Lewis"
- Re: HoA question
- From: "John W. Krahn"
- HoA question
- Prev by Date: Re: HoA question
- Next by Date: HTML to DOC Converter
- Previous by thread: Re: HoA question
- Next by thread: Re: HoA question
- Index(es):