... for my $f (@list) { for my $s (@list) { open my $dummy, '>', "Extraction_$f$s.txt") or die $!; } }