open my $resultfile, '>>', $filepath...