You may wish to try changing your umask. Try perldoc -f umask
or man umask
. The umask influences the permissions of created files, usually by 'masking' off permission bits which you don't want. Try something along the lines of:
near the top of your code.
Is this going out live?
No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist