Hi wdhammond,
The code you've provided isn't runnable, and doesn't show the code that actually writes to the file; it would be better if you could show us a Short, Self-Contained, Correct Example. There isn't anything obvious in the code you posted that would influence the file permissions.
Perhaps you need to check your umask, both by running the umask command from the command line, as well as checking the umask in the script via something like printf "%04o\n", umask;. If either of those show, for example, 0077, that would explain the issue.
Update:
I noticed in another post on your site that "stat" does not return a value unless "File::stat" in included.
No, stat is a builtin that should always be available. File::stat just replaces the builtin stat with a function that returns an object instead of a list of values. But in either case, stat only reads the file information, and does not modify it, so that won't be the cause of the problem.
Hope this helps,
-- Hauke D
In reply to Re: File permissions problem (updated)
by haukex
in thread File permissions problem
by wdhammond
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |