in reply to How to group keys by hash value

... or use Class::Struct;
package record; use Data::Dumper; use Class::Struct; my $i = 0; struct( first_name => '$', last_name => '$', ssn => '$', nicknames => '@', ); my $person = new record; $person->first_name("John"); $person->last_name("Doe"); $person->ssn("123-45-6789"); my @nicks = qw( jester ice-man maverick ); $person->nicknames($i++,$_) for @nicks; print Dumper(\$person); print "@{$person->nicknames}";
lots of ways to do it.. cause hey, it's Perl :-) JamesNC