Uhm,
I'm not really sure if I got your question right, but would it be Days_in_Month? A quick glance at the manpage of Date::Calc and a search for 'last' also gave an example of 'How can I calculate the last business day (payday!) of a month'. That should be a good start ...