use FileHandle;
my %fh;

my @filehandlename=("A","B","C"); ##文件句柄的名字;

for my $filehandlename (@filehandlename){

  $fh{$filehandlename}=FileHandle->new("> $filename"); ##$filename 代表输出文件的名字

  $fh{$filehandlename}->pritn("输入的字符串");

  $fh{$filehandlename}->close();

}

04-16 14:18