[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Deleting from a hash of hashes



I'm having trouble deleting entries from a hash of hashes and hopefully you
folks can help me out. The code that I'm using (perhaps incorrectly) is
such:

foreach $key ( keys %HOH)
   {
      if ( $HoH{$key}{DISPLAY_TIME} > $CURRENT_TIME )
         {
            delete $HoH{$key};
         }
   }


$key represents a numerical list of keys and its corresponding values is
another hash of which "EXPIRY_TIME" is one of the keys. I'm able to do
everything else I want to do expect delete entries. Both EXPIRY_TIME and
CURRENT_TIME are in Epoch seconds but no matter what, when I run the script
no listings get deleted even when their DISPLAY_TIME (i.e. the first day
they should appear) is greater than CURRENT_TIME (the current day).

If you go to www.air.on.ca/users/wadsond/cgi-bin/careers/careers.cgi you
can see the script in action. Basically, the majority of the listings are
dated to display starting Saturday, May 22nd but they still appear before
than even though the above code should remove them from the hash of entries
that will be displayed later in the script.

Perhaps I'm just invoking the delete command improperly for a hash of
hashes but I'm getting really frustrated and the documentation for hash of
hashes is pretty vague...

Thanks in advance.


 David Wadson (wadsond@air.on.ca)
      Composing Room Foreman
----------------------------------
      The Chronicle-Journal
  Thunder Bay, Ontario, Canada

www.netreader.com/chroniclejournal
----------------------------------



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org