title: Perl : calculation of time in format hh:mm:ss,sss
body: <p>I need to calculate the time difference between these two variables in Perl :</p>
  
  <pre><code>my $end = "17:23:31,576";
  my $start = "17:23:30,858";
  </code></pre>
  
  <p>How do I calculate the time difference (<code>$end - $start</code>) ? It's important the the returned value keeps the same format.</p>
  
  <p>I would prefer, ideally, to do that with a native function</p>
  
  <p>I've already tried packages like <code>Time::Piece;</code> and <code>DateTime::Format::Strptime</code>; but couldn't make it work.</p>