in reply to Write a file if grep finds a pattern?

I thought i could use the returncode "0"
I don't see you using any return code (other than the one returned by open. But what puzzles me more is that you didn't get Use of uninitialized value $_ in print. AFIK, in your particular program, $_ isn't implicitly set anywhere.

-- 
Ronald Fischer <ynnor@mm.st>