while (! eof inFile) { $line .= ' ' . ; chomp $line; next if ! ($line =~ /data\sto\s(.*?)\s+/i) and ! eof inFile;