title: date conversion in perl
body: <p>I am using perl to access a DB from where I am getting the date in DD-MON-YYYY format. I need to perform 2 operations:</p>
  
  <ol>
  <li>Convert this format to a MM/DD/YYYY format.</li>
  <li><p>Compare this date with two dates to see if it lies in that time range.</p>
  
  <p>my $chdate = '15-Feb-2013';</p>
  
  <p>sub get_stats
  {</p>
  
  <pre><code>my %map = ( 'Jan' =&gt; '01', 'Feb' =&gt; '02', 'Mar' =&gt; '03', 'Apr' =&gt; '04',
              'May' =&gt; '05', 'Jun' =&gt; '06', 'Jul' =&gt; '07', 'Aug' =&gt; '08',
              'Sep' =&gt; '09', 'Oct' =&gt; '10', 'Nov' =&gt; '11', 'Dec' =&gt; '12');
  
      $chdate =~ s/(..)-(...)-(....)/$map{$2}\/$1\/$3/;
      print "New date: $chdate";
  </code></pre>
  
  <p>}</p></li>
  </ol>
  
  <p>How do I perform the (2) operation?</p>
  
  <p>I have an old version of Perl (no Time::Piece module), which I do not have privileges to update :)</p>