Hi Miller - I am totally lost,I just cant figure out what is wrong with the below code.The "IN"statement never gets printed.I am sharing my full code.Appreciate any help

#!/usr/bin/perl -w use strict; use warnings; #use File::Find::Rule; use File::Find; use Cwd; use File::Basename; my $cwd = getcwd(); my @folders; my %seen; my (@folder_mk,$folder,$mk,$folder_present,$folder_not_present); my $CASES; my $file_name="Case_sensitivities.txt"; if ( -e $file_name ) { #print "IN $file_name\n"; #chmod 0777, $file_name or die $!; unlink $file_name or die "Unable to unlink $file_name: $!"; } open(my $FOLDERS, '+>', "dirs.log") or die $!; find(sub { push @folders, "$_\n" if -d $File::Find::name && !$seen{$_}++; print $FOLDERS "$_\n" if -d $File::Find::name && !$seen{$_}++; }, $cwd); #print "\nHeader array:@headers\n"; #my @headers = File::Find::Rule->file->name('*.h')->in($cwd); #my $header_file; foreach $folder (@folders) { next if $folder =~ /^\.+$|inc|src|arm|le-v7|config/; @folder_mk=`find.exe . -name "*.mk" -print0 | xargs -0 grep -i $fo +lder`; foreach $mk(@folder_mk) { print "\nFOLDER:$folder\n";#prints FileMuxInternaldefs print "\nMK:$mk\n";#prints ./AACBaseFileLib/common.mk: + $(PROJECT_ROOT)/../FilemuxInternalDefs/inc \ if ($mk =~ /\Q$folder\E/i) #this match failing for th +e give input { print "\nIN\n";#never enters the loop if ($mk !~ /\Q$folder\E/) #this match failing for the give +input { print "CASE-SENSITIVE:$mk\n"; } } } $mk=" "; }

In reply to Re^2: Cont:match failing by Anonymous Monk
in thread Cont:match failing by Anonymous Monk

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.