open my $output, '>', $localFile || die "Cannot write to $localfile: $!\n";