The option permissions sets the permission of the file if it creates and must be set as a octal value. The permission need to be in octal and are modified by your process's current "umask".

That means that you have to use the unix style permissions such as chmod. 0640 is the default permission for this option. That means that the owner got read and write permissions and users in the same group got only read permissions. All other users got no access.

Take a look to the documentation of sysopen() to get more information.

It's possible to set a pattern in the filename that is replaced with a date. If the date - and the filename - changed the file is closed and reopened with the new filename. The filename is converted with POSIX::strftime.