open(DATA, $dac03_location."/".$file) or die "Cannot open the file!"; #Store the text in an array, easier to work with while(){ chomp; push(@data_file,$_); } close(DATA);