Hi Ken, cutting and pasting the whole array and file would of been two large so I just tried to create snippets of the data which included all scenarios of possibilities. You are correct, the data source was sloppy I appologies.

After observing your code (and thanks for the assistance) and digesting your points. Point 1 is a typo, correct. Point 2 the data was correct, there could be cases where server= is a missing attribute

Point 3 you're right

'server=cvmfsser3::FS=/opt/apps'

This should be single :

Your code is nearer enough what I need but one thing seems to be throwing it out at present

'server=cvmfsser1, cvmfsser2:FS=/opt/apps',

even if two servers appear as comma seperated, this should indeed part match but against FS and Server (server being that there is one of the two in the comma seperated list whihc exist in the file. Your code part matches against the fileystem but would not part match against the server if the filesystem didnt exist

cvmfsser1::/opt/apps/::app_support cvmfsser3::/opt/apps/::app_support
. As you can see in the data output, it is only showing up as a part match against the fileysstem. If the filesystem didnt exist, Id need to to part match against
'server=cvmfsser1

I hope I have explained myself well enough. Thanks in advance


In reply to Re^2: Matching array elements against file by Mark.Allan
in thread Matching array elements against file by Mark.Allan

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.