Re: [code-review] Tie::Hash::Expire
Jeff 'japhy' Pinyan <[email protected]> Sun, 1 Feb 2004 23:16:16 -0500 (EST)
| Newsgroups | gmane.comp.lang.perl.code-review-ladder |
|---|---|
| Message-ID | <[email protected]> |
On Feb 1, Jeff Yoak said:
>I just became aware of this list a few minutes ago. What a great idea!
Me too; I said on IRC "there should be a critique-specific mailing list",
and poof, someone pointed me to this mailing list. This is my first day
here.
> Yesterday I uploaded the first version of my first CPAN module,
>Tie::Hash::Expire, a package providing hash keys that expire and cease to
>exist after a user-set period. I would be much obliged if anyone here
>would take a look.
I've noticed that the hash behaves like an ordered hash -- that the keys
come back in the order you store them. I'm curious why. It seems that a
much simpler timeout-hash could be made if this wasn't required; although,
when I then think about it, that would result in the hash possibly being
modified while iterated over, resulting in key re-ordering, resulting in
POSSIBLY getting the same key twice when doing
while (my ($k,$v) = each %hash) { ... }
So... I guess an ordered hash is required. Nevermind my initial rant.
That said, I'll look over the code, and make some suggestions in the
morning. Nice module, though. Cool concept.
--
Jeff "japhy" Pinyan [email protected] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]