my $x = rand(65536); foreach (@lines) { open(my $fh_out, '>', sprintf('prefix%04X.txt', $x)) or die; print $fh_out $_; $x = ($x + 1) % 65536; } #### my $x = 0; foreach (@lines) { open(my $fh_out, '>', sprintf('prefix.%04d.txt', $x++)) or die; print $fh_out $_; } #### while (<$fh_in>) { open(my $fh, '>', sprintf('prefix.%04d.txt', $.)) or die; print $fh_out $_; }
## my $x = 0; foreach (@lines) { open(my $fh_out, '>', sprintf('prefix.%04d.txt', $x++)) or die; print $fh_out $_; } ##
## while (<$fh_in>) { open(my $fh, '>', sprintf('prefix.%04d.txt', $.)) or die; print $fh_out $_; }