>>>>> "MG" == Marcel Grunauer <marcel.grunauer@lovely.net> writes: MG> On Wed, 18 Aug 1999 18:06:49 -0400, you wrote: >> this is as evil as symrefs. why not do a HoH? you are generating the >> keys of the first and second levels with the calls without who, so that >> is not a problem. i leave the coding as an exercise to this list. i am >> going to a party now and in 2 days, off to monterey! MG> Thanks, Uri. Normally I'm as opposed to symrefs as anyone, but for MG> some reason (late night?) didn't spot them there, or know what to do MG> about it. Blindingly obvious, though. there aren't any symrefs in your first version. i was saying your use of eval was as evil as symrefs. and you basically did similar stuff, creating the names of variables on the fly which what is considered bad MG> Monterey... hmmm... Not as easy to get to when you're in Vienna MG> (that's Austria, not Virginia). well, i know someone from australia (that's 'austria' =~ s/(?=ia)/al/ ) who is coming. MG> sub AUTOLOAD { MG> ($_ = $AUTOLOAD ) =~ s/^.*:://; MG> s/(?:(^_)?)the_//gi; MG> if (/^who_is_(\w+)_of_(\w+)$/) { $autohash{"$1_by_key"}{$2} } MG> elsif (/^who_is_(\w+)_(\w+)_of$/) { MG> $autohash{"$2_by_value"}{$1} } MG> elsif (/^(\w+)_of_(\w+)_is_(\w+)$/) { MG> $autohash{"$1_by_key"}{$2} = $3; MG> $autohash{"$1_by_value"}{$3} = $2 MG> } elsif (/^(\w+)_is_(\w+)_of_(\w+)$/) { MG> $autohash{"$2_by_key"}{$3} = $1; MG> $autohash{"$2_by_value"}{$1} = $3 MG> } MG> } more like what i has thought this should be. uri -- Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting Have Perl, Will Travel ----------------------------- http://www.sysarch.com The Best Search Engine on the Net ------------- http://www.northernlight.com "F**king Windows 98", said the general in South Park before shooting Bill. ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe