try this system(": > $filename");
In reply to Re: How to erase the file content by knsridhar in thread How to erase the file content by kamesh3183