#!/usr/bin/perl use warnings; use strict; my @fh; # will store the filehandles. # Open multiple files. for my $i (1 .. 10) { open $fh[$i], '>', "file-$i" or die $!; } # Write in each. Not sure whether it's simultaneous enough. for my $i (1 .. 10) { print {$fh[$i]} $i; }
In reply to Re: Creating multiple files and writing in each file
by choroba
in thread Creating multiple files and writing in each file
by irthiza90
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |