- or download this
open FILEHANDLE, filename;
- or download this
open FILE, "myfile" or die "Couldn't open: $!";
@lines=<FILE>; #get all the lines from the file
close FILE;
- or download this
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;