int $fileid = `fopen $filename "w"`; fprint $fileid "my lines of code whatever I want to write \n"; fclose $fileid; That's how you do it. Alan