populating a hash key using a variable

2002-12-11 Thread Ian Zapczynski
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

RE: populating a hash key using a variable

2002-12-11 Thread Kipp, James
> > 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

Re: populating a hash key using a variable

2002-12-11 Thread Ian Zapczynski
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

RE: populating a hash key using a variable

2002-12-11 Thread Kipp, James
> > 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

Re: populating a hash key using a variable

2002-12-11 Thread Rob Dixon
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

Re: populating a hash key using a variable

2002-12-11 Thread Ian Zapczynski
/ 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