in reply to compound structure? 4way-hash
The drawback of course is that whenever the @address data changes you have to update the index hashes accordingly.my @address; my %by_name = map { ($_->{name}, $_) } @address; my %by_file = map { ($_->{file}, $_) } @address; my %by_mac = map { ($_->{mac}, $_) } @address; my %by_ip = map { ($_->{ip}, $_) } @address; print $by_ip{"1.2.3.4"}{name}, $by_name{foobar}, "\n";
Makeshifts last the longest.
|
|---|