in reply to redirect grep output

Any ideas?
Yes.
  1. use strict;
  2. use warnings; or -w on Perl < 5.6
  3. check the sucess of system calls.
  4. use strict;
  5. use whitespace in your system calls.
  6. use <code> tags when posting code here
  7. use strict;