These are two open arguments. The point . is a string concatenation operator in Perl. If open is called with two arguments, the second argument contains both mode and path.
In your case, it will open a file called $file for writing.
However, for several reasons, you should not do this. The most common use is a three-argument descriptor and lexical file descriptors instead of a global GLOB file descriptor.
The lexical file descriptor ensures that Perl implicitly closes handel for you as soon as it goes out of scope. Using different arguments for the mode and file name is a security issue, because otherwise the attacker could drag and drop changes to the file name into mode.
open my $fh, '>', $file or die $!;
In addition to the now lexical file descriptor and the separation of mode and file name, we also check for errors in this code, which is always a good idea.
source share