Hello all,
I'm obviously making a silly mistake here and would appreciate it if
someone can point out my error. I am trying to populate a hash of a
hash in a while() loop. Here is what I have:
my $i = 0;
my %hash = ();
while () {
$hash{SOMETHING}{$i} = $something;
$hash{SOMETH
>
> Hello all,
>
> I'm obviously making a silly mistake here and would appreciate it if
> someone can point out my error. I am trying to populate a hash of a
> hash in a while() loop. Here is what I have:
>
> my $i = 0;
>
> my %hash = ();
>
> while () {
> $hash{SOMETHING}{$i} = $so
I am not populating from a file, actually. I'm populating from the
output of $sth->fetch from DBI. The $something and $something_else
variables in this case are numbers which have been defined by the output
of that method.
If I do $hash{SOMETHING}{0} = $something;
Then my hash is populated
>
> If I do $hash{SOMETHING}{0} = $something;
>
> Then my hash is populated correctly. I am only not getting
> results if I
> do $hash{SOMETHING}{$i} = $something. The key here is how I am using
> the variable $i in my hash.
>
>
I tried this on my machine and it worked fine:
my $i;
for ( 1
EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 4:11 PM
Subject: RE: populating a hash key using a variable
> >
> > If I do $hash{SOMETHING}{0} = $something;
> >
> > Then my hash is populated correctly. I am only not getting
> > r
/ rather than what you've actually coded :-}
Cheers,
Rob
- Original Message -
From: "Kipp, James" <[EMAIL PROTECTED]>
To: "'Ian Zapczynski'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 4:11 PM
Subject: RE: p