use Fcntl qw( O_CREAT O_RDWR ); sysopen(FILE, "$file", O_RDWR|O_CREAT, 0755) ...