in reply to Hashes of Arrays of Hashes (sometimes of Arrays)
Do note that this is a very bare bones example, with no error checking, no way to set new values for the object's various components, etc.package OBJ; sub new { shift; bless {@_}, 'OBJ'; } sub normal { shift->{normal} } sub listl { my $self = shift; my $index = shift; my $key = shift; $self->{listl}[$index]{$key}; } ##### package main; my $obj = new OBJ(normal => "some text", listl => [{keys => vals}, {keys => vals}, ]); $normal = $obj->normal(); $value = $obj->listl(0,'key');
--DrWhy
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hashes of Arrays of Hashes (sometimes of Arrays)
by Bro. Doug (Monk) on Aug 12, 2006 at 00:37 UTC |