in reply to Testing for ge N && lt Y

You have:

$unapproved{$user}{$server}{last_mail} = 31
which looks like a number, and I guess $today is probably 4, but you're using the le operator which operates on strings. A string compare sorts "31" before "4", so the test passes.

If you use a numeric compare such as "<=", it'll more likely do what you want.

Hugo