Then all you have to do is read from your FILEHANDLE with
<FILEHANDLE>. If you assign this to a scalar
like $line=<FILE>, you'll get one line.
However if you set it equal to an array like
@lines=<FILE> you'll get all the lines.

open FILE2, "myfile2" or die "Couldn't open: $!";
while(<FILE2>){ #reads in from the file a line at a time and puts it +in the default variable
print $_; #print the default variable $_ which the line is stor+ed in.
}
close FILE2;

Seeing that no one is using IO::File to open files, I will state the alternative (preferred) method of file handling. I know this is an old question, I am just stating the obvious here, but this post is to offer guidance to the beginner, isn't it?

As it is common in Perl to find several ways to do the same thing, I will demonstrate a very simple way to construct a file reading function where an array is returned in which each element represents one line of the file.