use strict;
use warnings;
my @filehandle;
my $num_handles=2;
for my $num (1..$num_handles) {
open my $fh,">c:/File$num.txt"
or die "Cant open File$num.txt for writing: $!";
push @filehandle,$fh;
}
my $fh=$filehandle[0];
print $fh "Hello\n";
####
use IO::Handle;
####
$filehandle[0]->print("Hello\n");