>>>>> "Brian" == Brian  <[email protected]> writes:

Brian> Just curious if there is a particular reason Shawn did not use the 
reverse function:

Brian> my %hash  = (
Brian>           './b/fb'        => 'fb',
Brian>           './b/c/fd'      => 'fd',
Brian>           './b/l/c/f2'    => 'f2',
Brian>           './b/g/f/r/fc'  => 'fc',
Brian>           './b/g/h/r/fb'  => 'fb'

Brian>       );

Brian> my %inv_hash = reverse %hash;

Try it and see.  The big problem is that there are two entries that
would have both wanted the key of "fb".
One of them would have been discarded at random.  Not good in this case.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to