title: Perl script to convert logged datetimes to UNIX epoch timestamps
body: <p>I have a log file (<code>datetimes.log</code>) consisting of hundreds of thousands of timestamps of the form:</p>
  
  <pre><code>YYYY-MM-DD HH:mm:ss
  </code></pre>
  
  <p>For example:</p>
  
  <pre><code>2013-03-28 06:43:51
  2013-03-28 06:43:55
  2013-03-28 06:44:03
  ...etc.
  </code></pre>
  
  <p>I'd like to write a simple Perl script to output a new <code>unix_timestamps.log</code> file that contains the same entries, but instead of the datetime, to have the corresponding UNIX epoch timestamp. For the example above, the <code>unix_timestamps.log</code> file would have the following info in it:</p>
  
  <pre><code>1364453031
  1364453035
  1364453043
  ...etc.
  </code></pre>
  
  <p>The only thing I can think of is <code>perl convert_2_timestamps.pl</code>:</p>
  
  <pre><code>#!/usr/bin/perl
  
  use warnings;
  use strict;
  
  grep m/_(\d{4})(\d\d)(\d\d)/ | POSIX::mktime(?, ?, ?, ?, ?, ?) &gt; unix_timestamps.log
  </code></pre>
  
  <p>But not sure how to transfer the parameters into <code>mktime</code>, and not sure if this is even the right approach. Thanks in advance.</p>