title: Easiest way to open a text file and read it into an array with Perl
body: <p>Adding a standard Perl file open function to each script I have is a bit annoying:</p>
  
  <pre><code>sub openfile{
      (my $filename) = @_;
      open FILE,"$filename" or die $!;
      my @lines = &lt;FILE&gt;;
      return @lines;
  }
  </code></pre>
  
  <p>and I can create a Perl module to do this, but this is so simple I'm sure there should be one out there already.</p>
  
  <p>I'm trying to find a way to read a text file into an array, and I cant seem to find a Perl module out there that can do this simple task... maybe I'm looking too hard and it already came with the standard 5.10 install.</p>
  
  <p>Optimally I believe it would look something like this:</p>
  
  <pre><code>my @lines = Module::File::Read("c:\some\folder\structure\file.txt");
  </code></pre>