title: Compact way of getting file checksum in Perl
body: <p>I am looking for ways to get file checksums in Perl but not by executing the system command <code>cksum</code> -- would like to do it in Perl itself because the script needs to be portable between UNIX and Windows. <code>cksum &lt;FILENAME&gt; | awk '{ print $1 }'</code> works on UNIX but obviously not in Windows.  I have explored <a href="http://perldoc.perl.org/Digest/MD5.html" rel="noreferrer">MD5</a> but it seems like getting a file handle is necessary and generally it doesn't seem like a very compact way to get that data (one-liner preferable).  </p>
  
  <p>Is there a better way?</p>