The default permissions of a newly created file are set by umask. If your user process has a different umask than your script process, you may have troubles.
I wish I could provide a good summery of how umask interacts with parent directory permissions and the many places it can be set, but I don't think I could do a shorter or more accurate job than the man pages or a more knowledgeable monk.
I reached my current incomplete understanding of umask through the following commands.
...and searched my ftp server's docs to realize that umask needed to be set in my ftp server's config file.man umask grep -d recurse -i umask /etc | more more <files that seem relevant> man <files that seem relevant>
Your problem is obviously not ftp related so perhaps:
perldoc -f umask might help.
You might also toss a debugging system('ls -l'); into your script just after you create your $new file.
Hope this helps (or is at least relevant...)
In reply to Re: can't get chmod to work
by mandog
in thread can't get chmod to work
by George_Sherston
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |