I'm working with some complex data (array of hashes in
this case) and I'm wondering if there's a good way to
do a reverse lookup? So far I have the following:

for my $i (0.. @names-1) {
        if ($names[$i]{'xml_index'} == $xml_index){
                $return = $names[$i]{'name'}
        }
        last if $return;
}

Which works fine, but I'm pretty sure there has to be
a more efficient way to do it that will save cycles.

~wren

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

Reply via email to