in reply to cleaning out a file

Hate to introduce a non-perl item ;) but a bash one-liner is:
: > filename

Use the tools you've got is what i always say...
This also preserves all the file permissions and attributes...
Assuming you're on Unix of course (or bash on some other platform).