Slightly longer answer: Read perldoc perlopentut and then read perldoc -f open
In reply to Re: empty a file by Nkuvu in thread empty a file by GS