in reply to Clearing out the file

Hi Ananymous Monk,

If you want to make the file size to zero and needs the file,you can give like this,
open FILE,">>filename"; truncate FILE, 0; close FILE
Hope this maybe useful for you.

Thanks and Regards,
madtoperl.

Replies are listed 'Best First'.
Re^2: Clearing out the file
by Hue-Bond (Priest) on Jul 25, 2006 at 14:20 UTC
    open FILE,">>filename"; truncate FILE, 0; close FILE

    truncate works also on filenames:

    $ echo abcde > file $ perl -e 'truncate "file", 2' $ cat file ab

    --
    David Serrano