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!";
In reply to Re^2: Creating multiple files and writing in each file
by AppleFritter
in thread Creating multiple files and writing in each file
by irthiza90
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |