title: How to copy all the files of a particular type using Perl?
body: <p>Right now, I am using something like</p>
  
  <pre><code>copy catfile($PATH1, "instructions.txt"), catfile($ENV{'DIRWORK'});
  </code></pre>
  
  <p>individually for each of the <code>.txt</code> files that I want to copy. This code is portable as it does not use any OS specific commands.</p>
  
  <p>How can I copy <strong>all</strong> the text files from <code>$PATH1</code> to <code>DIRWORK</code>, when I do not know the individual names of all the files, while keeping the code portable?</p>