my $thisout = substr($i, 0, index($i, ".")) . ".txt"