Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!chx400!pan!jw From: jw@pan.UUCP (Jamie Watson) Newsgroups: comp.lang.perl Subject: How to zero a file Message-ID: <891@pan.UUCP> Date: 23 Dec 89 06:46:41 GMT Reply-To: jw@pan.UUCP (Jamie Watson) Organization: Adasoft AG, Solothurn, Switzerland Lines: 11 What is the preferred way to zero a file in perl? In shell scripts I use "> filename", so in perl I can 'exec "> filename"', but it seems to me that there should be a way to do this without using exec. In a similar vein, what is the preferred way to copy a file? I could obviously just crank up 'exec "cp old new"', but again I wonder if there is some "better" way to do this entirely within perl. Copying a line at a time, with "while () print" doesn't seem to me to be an ideal solution. jw