in reply to write multiple files to a new directory

  1. Where does @files (Ln 6) get populated?
    And, (based on your statement, "I need to first select files that contains (sic) some keywords...")
  2. If @files is supposedly populated by some selection mechanism, what's the selection code look like?