my $filepath = File::Spec->catfile($folder, $reportfile); open my $reportfile, '>>', $filepath ...;