in reply to perl script to calculate beg and end of current month

What database? You could also just write a SQL solution..

As for perl, here's a Date::Calc solution:
use Date::Calc qw(Today Add_Delta_YMD Days_in_Month); my ($year, $month, undef) = Add_Delta_YMD( Today(), 0, -1, 0 ); printf "start: %04d-%02d-%02d\n", $year, $month, 1; printf " end: %04d-%02d-%02d\n", $year, $month, Days_in_Month($year, +$month);