Hi all, I would like to read in a file and print out to a new file UNTIL I reach a key word in the file.
I tried something like while (<>) { if !/KEYWORD/; print $ >> dest.txt; } but that seems to copy all lines of the file except the one(s) contining KEYWORD. How can I have this exit and close dest.txt when I reach the line containing KEYWORD? Maybe while (<>) { if /KEYWORD/; exit else print $ >> dest.txt; } What would be the best approach? Thanx for any help! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]