sub preprocess { my @to_return; foreach (@_) { #don't follow down advanced directory paths #Do call wanted() on .log files (and any directory not #underneath an "advanced" one push @to_return, $_ if ( ( -f and /\.log$/ ) or !( -d _ and /advanced/) ); } return @to_return; }