in reply to permissions, open and chown

ITYM `chmod' not `chown'. And open creates files with a mode of 0666 which gets xor'd against the current process' umask (as perldoc -f open explains).

Update: As a clarification, the umask is bitwise xor'd with 0666, so if your process currently has a umask of 022 (a sane, common value) would result in permissions of 0644 on the file.