Hi! all, i am trying to print 100 files with 100 names, just the names, ('file-A.txt' or 'file-B.txt') in each file. in file 1, fileA will be printed 1 time and fileB 99 times, and in file 2, 2 times fileA and 98 times fileB and so on.
here is what i have done sofar. the program works but only prints one file and does not loop through. please suggest a working logic.
thanks in advance
#!/usr/bin/perl -w
my ($count, $counts);
$x=1;
$y=100-$x;
open(FILEW1, ">$x-times-fileA.txt") || die "couldn't create the file\n";
unless ($x==100){
$count=1;
while ($count<= $x) {
print FILEW1"file-A.txt\n";
$count++;
}
$counts=1;
while ($counts<=$y) {
print FILEW1"file-B.txt\n";
$counts++;
}
$x++;
}
here is what i have done sofar. the program works but only prints one file and does not loop through. please suggest a working logic.
thanks in advance
#!/usr/bin/perl -w
my ($count, $counts);
$x=1;
$y=100-$x;
open(FILEW1, ">$x-times-fileA.txt") || die "couldn't create the file\n";
unless ($x==100){
$count=1;
while ($count<= $x) {
print FILEW1"file-A.txt\n";
$count++;
}
$counts=1;
while ($counts<=$y) {
print FILEW1"file-B.txt\n";
$counts++;
}
$x++;
}