PDA

View Full Version : Perl Guru needed - i'm stuck :(


richard
04-10-2001, 08:08 AM
Hi.

If anyone knows any perl gurus, can you send me their infos, i'm stuck on a complex data structure.

What i want to do, is have a hash of hashes of arrays.

A hash of arrays works:

push @{$hash1{key}}, $value

What i want to do is:

push @{$hash1{Hash2}{key}}, $value

but it doesn't work.


To put this into context, i'm making a "recip maker" script.

$hash1 = hash of "recip groups"
$hash2 = "url" and "img" values, which are arrays of the urls/img paths for each recip group.

I'll have another think about how i can get around this, but i'd really like to know how to make hashes of hashes of arrays for other stuff too http://bbs.adultwebmasterinfo.com/ubb/biggrin.gif

Rich.

richard
04-10-2001, 08:38 AM
$recips{id}={url=>"www.somesite.com",
img=>"somesite.gif",
};
push @{$all{groupA}}, $recips{id};

print $all{groupA}[0]{url};

That works, not quite the same as i wanted, but sod it, its good enough for this.

http://bbs.adultwebmasterinfo.com/ubb/wink.gif