#! /usr/bin/perl use strict; use warnings; my $searchstring = 'usr/include/malloc.h'; my @files = ( 'D:/Igor_Perforce/DTBS/driver/qnx/util/readsmart/trunk/src/readsmart.c', 'D:/Igor_Perforce/DTBS/driver/qnx/util/readsmart/trunk/src/usr/include/malloc.h', ); for my $f ( @files ) { if ( $f =~ /$searchstring/i ) { print "\nfound $f\n" } else { print "\nnot found\n" } }