title: perl how to convert a string to Datetime?
body: <p>I tried to convert a string to date in perl, but get error. </p>
  
  <pre><code>use strict; 
  use warnings;  
  use DateTime;  
  use Date::Manip;
  
  my $date = ParseDate("20111121");
  print "today is ".$date-&gt;day_of_week."\n"; 
  </code></pre>
  
  <p>error</p>
  
  <pre><code>Can't call method "day_of_week" without a package or object reference 
  </code></pre>
  
  <p>Looks like the package import has problem ...</p>
  
  <p>Thanks</p>