title: How do I use Perl's localtime with print to get the timestamp?
body: <p>I have used the following statements to get the current time.</p>
  
  <pre><code>  print "$query executed successfully at ",localtime;
    print "$query executed successfully at ",(localtime);
    print "$query executed successfully at ".(localtime);
  </code></pre>
  
  <p><strong>Output</strong><br><br></p>
  
  <pre><code> executed successfully at 355516731103960
   executed successfully at 355516731103960
   executed successfully at Wed Apr  7 16:55:35 2010
  </code></pre>
  
  <p>The first two statements are not printing the current time in a date format.
  Third statement only giving the correct output in a date format.</p>
  
  <p>My understanding is the first one is returning a value in scalar context, so it is returning numbers.</p>
  
  <p>Then in the second print I used localtime in list context only, why it's also giving number output.</p>