title: Open file matching a regex
body: <p>I'm trying to open a file contained within the same directory as the program I'm running.</p>
  
  <p>Rather than specifying the exact name of the file to read, I'd like to be able to match any filename ending in 'output.2.txt'. Something like this (but this doesn't work):</p>
  
  <pre><code>if ($input == 2) {
  my $seqs =~ m/output.2.txt/;
  open $genes, '&lt;', $seqs or die "Can't open '$seqs'"; 
  }
  </code></pre>