or download this
If MODE is `'<'' or nothing, the file is opened for input. If
MODE is `'>'', the file is truncated and opened for output,
being created if necessary. If MODE is `'>>'', the file is
...
length records. See the -i switch in the perlrun manpage for a
better approach. The file is created with permissions of `0666'
modified by the process' `umask' value.