Think about Loose Coupling | |
PerlMonks |
Matching array elements against fileby Mark.Allan (Sexton) |
on Jan 14, 2014 at 10:51 UTC ( [id://1070535]=perlquestion: print w/replies, xml ) | Need Help?? |
Mark.Allan has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks, just wondered if you can guide me on a more accurate way and a better solution of matching array elements against file content in below scenario. I have an array with data as follows:-
I also have a file, in the following format as follows
What I am looking for is an accurate match, if the line is complete match (ie server and fs) exist in the line of the file then this is a MATCH, if only server or file system exists in the line then this is PART MATCH and if server or FS does not exist then NO MATCH Example So looking through the array the following would match, part-match or not match against the file
Here's where I am at present but its not working as I want, because the bind operator matches for example just the /opt of a file system even if the fs /opt//db2ese does not exist in the array
Back to
Seekers of Perl Wisdom
|
|