in reply to using grep with multiple "+"
my $dirPath = 'c:\apps\c++\application'; print grep { /\Q$dirPath\E/ } ('c:\apps\c++\application\myfile.cpp'); [download]