Different ways to open a file in perl
The first method you showed is the newer and usually more favorable method. It uses lexical file descriptors (file descriptors that are lexically limited). The second method uses global file descriptors like global. Their coverage is wider. Modern Perl programs usually use the "my" version if they have no good reason.
You should take a look at perlopentut (from Perl documentation) and perlfunc -f open (from Perl POD) . These two resources give you a lot of good information. While you're there, check out the three versions of open arguments, as well as error checking. There is currently a really good way to open the file:
open my $file_handle, '>', $filename or die $!;