in reply to Calculate the nearest day

Various of the date/time modules on CPAN do that trick including the "kitchen sink" module Date::Manip. For example:

use Date::Manip; print UnixDate (ParseDate ('next monday'), '%c');

Prints:

Mon Apr 16 00:00:00 2007

DWIM is Perl's answer to Gödel