$SIG{__WARN__} = sub{ print STDERR "No permission for directory:$1\n" if $_[0] =~ m[\(([^\)]+)\)]; } find ..... $SIG{__WARN__} = undef; ...