<?xml version="1.0" encoding="windows-1252"?>
<node id="1001445" title="How to find the last date of the previous month?" created="2012-10-29 22:39:00" updated="2012-10-29 22:39:00">
<type id="115">
perlquestion</type>
<author id="896754">
MrSnrub</author>
<data>
<field name="doctext">
&lt;p&gt;How do I find out the last day of the previous month? In other words, I want a subroutine that, when run today, will return "09/30/2012" (a string in mm/dd/yyyy format)? If the function is run a week from now it will return "10/31/2012"? And if the function was run sometime last March, it would return "02/29/2012" (leap-year day). How do I do this? 
&lt;/p&gt;</field>
</data>
</node>
