in reply to How to substract date in perl?

Date::Calc is really useful for this sort of item.
use strict; use Date::Calc qw(Add_Delta_Days); my (undef, undef, undef, $day, $month,$year) = localtime(); $year+=1900; $month+=1; ($year,$month,$day) = Add_Delta_Days($year,$month,$day, -3); print join("-", $year,$month,$day)
Using localtime() is a little bit easier (and more portable, if that matters) than calling date from the shell. Good luck.

    --jaybonci