open FILEHANDLE, filename; #### open FILE, "myfile" or die "Couldn't open: $!"; @lines=; #get all the lines from the file close FILE; #### open FILE2, "myfile2" or die "Couldn't open: $!"; while(){ #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 stored in. } close FILE2;