http://www.perlmonks.org?node_id=1001455


in reply to How to find the last date of the previous month?

use Date::Simple qw/today/; use 5.010; my $d = today; my $month = $d->month; $d-- while $month == $d->month; say $d;

Or

use Date::Simple qw/today ymd/; use 5.010; my $d = today; $d = ymd($d->year, $d->month, 1) - 1; say $d;