Re: Tie::Hash::Regex vs Tie::RegexpHash
On Friday, May 25, 2001, at 03:18 PM, Cross David - dcross wrote: It's all very clever, but I'm not convinced how useful it is. Since when has that ever stopped us? Marcel -- $ perl -we time Useless use of time in void context at -e line 1.
Re: Tie::Hash::Regex vs Tie::RegexpHash
In T::R, the keys that you use in the hash are all treated as regexes. In effect you're saying if you look up a value using a key that matches this regex, then return this value. An added complication is that the key/value pairs are _ordered_ (the underlying object is an array, not a hash) so that you can guarantee that the regexes are checked in the same order as you added them to the hash. It's all very clever, but I'm not convinced how useful it is[2]. And it took a whole bunch more implementation than T::H::R did. Oh, and it's written for Perl 5.6, but the only reason I can see is so the author can 'use warnings'. I have wrote something in 1997 that needed exactly this (although I never dreamed of looking at CPAN for a module to do something so simple): I need to do a whois lookup for a domain name. Different domain names need to be looked up on different whois servers. So I have a list of domains and their relevant whois server, like: co.uk = whois.nic.uk. So I can look for, e.g., test.co.uk in the list and know that I need to query whois.nic.uk for info about that domain. -- sigs are for whimps
Re: Tie::Hash::Regex vs Tie::RegexpHash
At 02:18 PM 2001.05.25 +0100, Dave Cross wrote: [1] Hmmm... note to self - see if you can come up with a tied hash that abbreviates to T::H::C. Semi-plausible: Tie::Hash::Complex Not-plausible: Tie::Hash::Cannabis Might see the light of day?: Tie::Hash::Conway -- Chris Devers [EMAIL PROTECTED]
Re: Tie::Hash::Regex vs Tie::RegexpHash
Chris Devers [EMAIL PROTECTED] writes: At 02:18 PM 2001.05.25 +0100, Dave Cross wrote: [1] Hmmm... note to self - see if you can come up with a tied hash that abbreviates to T::H::C. Semi-plausible: Tie::Hash::Complex Not-plausible: Tie::Hash::Cannabis Might see the light of day?: Tie::Hash::Conway Presumably this will lead to a load of gags about not wanting to go too far from his stash? -- Piers Cawley www.iterative-software.com