in reply to set permissions automatically
sysopen might be what you want:
use Fcntl qw( O_CREAT O_RDWR ); sysopen(FILE, "$file", O_RDWR|O_CREAT, 0755) ... [download]