Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,I am trying to find if some files are present in an array using the below code,am using grep which is not giving an exact match.Ideally below the grep should fail.Can anyone advise how can I do that?
#!/usr/bin/perl -w use strict; use warnings; my @headers = ("fstring.h"); my $header_file ="string.h"; my @header_present; @header_present = grep( (/\Q$header_file\E/i), @headers); if (@header_present) { print "Header present\n";#should not print }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get an exact match of files
by Anonymous Monk on Mar 20, 2011 at 10:15 UTC |