open (FILEHANDLE,"file.txt") ; @data = ; close (FILEHANDLE) ; chomp(@data); ## this will cut off the \n or \r ## in the end of each line.