title: How can I list all files in a directory using Perl?
body: <p>I usually use something like</p>
  
  <pre><code>my $dir="/path/to/dir";
  opendir(DIR, $dir) or die "can't open $dir: $!";
  my @files = readdir DIR;
  closedir DIR;
  </code></pre>
  
  <p>or sometimes I use <code>glob</code>, but anyway, I always need to add a line or two to filter out <code>.</code> and <code>..</code> which is quite annoying.
  How do you usually go about this common task?</p>