i wrote this script and finally figured out, after hours and hours of searching, how to compare two md5 checksums:
use warnings; use strict; use Digest::MD5; my $file = "$ARGV[0]"; my $file1 = "$ARGV[1]"; open (my $fh, '<', $file) or die "Can't open '$file': $!"; binmode ($fh); open (my $fh1, '<', $file1) or die "Can't open '$file': $!"; binmode ($fh1); my $md5 = Digest::MD5->new->addfile($fh)->hexdigest; my $md51 = Digest::MD5->new->addfile($fh1)->hexdigest; print "\n", $file, "\n", $md5, "\n", "\n", $file1, "\n", $md51, "\n"; if ($md5 eq $md51) { print "\n", "The MD5's match perfectly", "\n"; } else { print "\n", "The MD5's do NOT match", "\n"; } system ( 'pause' );
but what i really need to do is get the md5 from $ARGV0 and compare that against an entire predefined @md5 array. essentially the $ARGV1 will be replaced by an array. i have searched and searched how to accomplish this. Like i say, all i need to do is compare the ARGV0 md5 against an entire array of md5's. any help or input would be very much appreciated :)

In reply to compare md5 from file against entire@md5 array by james289o9

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.