in reply to Re: Creating multiple files and writing in each file
in thread Creating multiple files and writing in each file

You can also use IO::Tee to create a handle that outputs to several files at once:

#!/usr/bin/perl use strict; use warnings; use feature qw/say/; use IO::Tee; my @fhs = map { open my $fh, ">", "file-$_" or die $!; $fh } 1..10; my $tee = new IO::Tee(@fhs); say $tee "AppleFritter!";

Replies are listed 'Best First'.
Re^3: Creating multiple files and writing in each file
by irthiza90 (Novice) on Mar 13, 2015 at 12:47 UTC

    thank you, it works.