in reply to Clear the contents of the text file

shroh:

Try perldoc -f truncate for a good function to clear the contents of a file. You may want to read through perldoc perlfunc and review the basic functions perl provides.

...roboticus

When your only tool is a hammer, all problems look like your thumb.