OK. So, I see six steps in your plan:

  1. process the MD5 of 'file'
  2. and then open 'file.md5'
  3. and hold its content in memory
  4. (to) compare to the processed MD5 of 'file'
  5. then if it matches move to the next file and corresponding .md5 file
  6. if there is an error, send it to the logmd5 subroutine for logging

Which parts of these have you already implemented and which are missing?

Maybe it helps to write these either as print statements or as comments in your code, and then replace them one by one with real code:

sub check_md5 { my( $path, $item ) = @_; # process the MD5 of 'file' # open 'file.md5' # hold its content in memory # compare to the processed MD5 of 'file' # if it matches move to the next file and corresponding .md5 file # if there is an error, send it to the logmd5 subroutine for logging };

What is the first item you can implement? Do that, then do the next item from the list that you can implement. Do that until either you've implemented everything or until you get stuck.


In reply to Re^5: Checking MD5 of files in directory with corresponding MD5 file type by Corion
in thread Checking MD5 of files in directory with corresponding MD5 file type by deedo

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.