Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a hash which looks like below(keys are all lowercase and value is the actual case).

$VAR1 = { 'seeklib ' => 'SeekLib ', 'test_src ' => 'test_src ', 'frames ' 'st_vx6953_5m_bayer ' => 'ST_VX6953_5M_Bayer

Now I am trying to grep for the key values in all the .mk files in cwd and push only those values which have a case-sensitive mismatch.Can someone advise how can I do that?

foreach my $filename(keys %hash) find(sub { push @{ $Hash_casemismatch{ $filename } }, grep( (/\/\Q$key\E#/), * +.mk); }, $cwd); }

Replies are listed 'Best First'.
Re: How to make sure only case-sensitive grep's get pushed
by moritz (Cardinal) on Mar 17, 2011 at 09:22 UTC

      The new line is a typo in both keys and values

      I want to search for file content.case-sensitivee mismatch meaning,for example am searching for the key "'seeklib" in the content of all the *.mk,the grep result should match the hash value('SeekLib),anything other than the value ,meaning seeklib,seekLib(note the case-sensitive difference) is a mismatch.

        So search case insensitively, and later compare all matches with the search string, and report only those matches are not eq the key.

        And note that the grep built-in searches in list, not in files.