in reply to greping in subdir

Others have suggested File::Find, but File::Find::Rule makes tasks like this easier. Try something like this (untested code):
use File::Find::Rule; my @file = find( file => name => '*.cc', in => '/clearb/pa/wBcn' ) or die "Find Failed: $!"; foreach (@file) { s/\.cc$/.cpp/; @args = system('/usr/bin/make', '-f', $_); $args == 0 or die "system @args failed: $?"; }
I also use perlfunc:system instead of backticks because you're not capturing the output of the make command. Also, this may be more secure because system with multiple arguments does not parse shell metacharacters such as * and ..