In other words, grep for the keys less than your test value, sort them, and take the last one.$now = (sort grep {$_ <= $now} keys %{$url{'monday'}})[-1];
Note: this has nothing to do with efficiency of the code (execution speed), but it does put it on one line (and feels kinda 'perlish' to me).
Russ
In reply to RE: Hash of hashes question
by Russ
in thread Hash of hashes question
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |