On Sat, Jul 30, 2005 at 06:41:35PM +0200, Louis Pouzin wrote:

> It is trivial to grow a hash within a hash, e.g.
> $H{$ip}{ng}{gov}{nigeria}{www}='';
> $H{$ip}{ng}{gov}{nigeria}{oil}='';
> 
> but I don't know a way to grow a hash within an array, such as:
> 
> $H{$ip}[0]{$nam4}='';  or
> $H{$ip}[0]={$nam4,''};
> 
> Both constructions erase all previous keys in the hash. Is there another way ?

The second one replaces the entire hash, of course, but the first one works
fine.  Why do you say it erases all previous keys in the hash?

There is no difference between a hash within a hash and a hash within an
array.

Ronald

Reply via email to