Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Technically, if you only need to transform the date into a sortable key, you can just fudge the maths behind it to make it faster. Say, the original date is MM-DD-YYYY (one of the most useless date formats available to modern computing), you could do something like this:
Now that the thing is an integer, you can compare numerically, which is faster than a string compare.
perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
In reply to Re^2: Get most recent data based on a date from an array of hashes.
by cavac
|
|