Forum Moderators: coopster & phranque

Message Too Old, No Replies

how do i create a new empty file in perl?

         

webguru

7:16 am on May 6, 2003 (gmt 0)

10+ Year Member



i want to create a new empty file, but is there a way to do it w/o using the system touch or shell touch command.

ShawnR

9:07 am on May 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



have you tried:

open MYFILE ">pathname"; # will erase the contents if already exists
open MYFILE ">>pathname"; # won't erase the contents if already exists

file will be created with permissions 0666

Shawn