John W. Krahn wrote:
M. Lewis wrote:
John W. Krahn wrote:
my %HoH;
while (my $line = ){
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
M. Lewis wrote:
> John W. Krahn wrote:
>>
>> my %HoH;
>>
>> while (my $line = ){
>> 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
John W. Krahn wrote:
my %HoH;
while (my $line = ){
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 -- straw
John W. Krahn wrote:
M. Lewis wrote:
I'm still experimenting with the HoA from a couple of days ago. I just
realized there is the possibility for having duplicate elements of the
array. How do I prevent that?
Use a hash instead of an array.
Thank you John. I wondered about that as I was c
M. Lewis wrote:
>
> I'm still experimenting with the HoA from a couple of days ago. I just
> realized there is the possibility for having duplicate elements of the
> array. How do I prevent that?
Use a hash instead of an array.
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use Data::Du
I'm still experimenting with the HoA from a couple of days ago. I just
realized there is the possibility for having duplicate elements of the
array. How do I prevent that?
Thanks,
Mike
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper::Simple;
my %HoA;
while (my $line = ){
c