Hello Perl Monks I am new to Perl and I am having a problem trying to compare two text files and from what I have read a hash should be able to solve my problem. I am working on a unix system and what I am trying to do is to compare what is currently mounted against a master configuration file of what should be mounted. I have created a file with what is currently mounted and this is looks like this. There are alot more entries than this but this is just a small sample (mount point and volume where mounted):

/home filer1232:/vol/home1 /mystuff filer1233:/vol/project /data filer1234:/vol/example_data /tools filer1235:/vol/my_tools
The master configurtation file I have which lists everything that should be mounted looks like this (there are alot more entries than this but this is just a small sample):
/home filer1232:/vol/home1 /mystuff filer1233:/vol/project /data filer1234:/vol/example_data /software filer1255:/vol/my_software /tools filer1235:/vol/my_tools /docs filer146:/vol/my_documents
What I am having trouble with is creating a hash. I can read both of these two files into two separate arrays but what I am struggling with is how to output the difference. For example I have array1 which contains master configuration of everything that should should be mounted (mount point and volume mounted on) and I want to compare this with array2 which has whats currently mounted (mount point and volume mounted on). I basically what to be able to find whats not currently mounted as per the master configuration file. Please can you help me I have been struggling with this for ages


In reply to How to find the difference between two text files using a hash array by NewLondonPerl1

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.