#!/usr/bin/perl use strict; use warnings; my $temp_file = $ENV{'APPDATA'} . '\test.tmp'; $temp_file = '"' . $temp_file . '"'; print "|$temp_file|\n"; open(my $fh, '>', $temp_file) or die "Error opening $temp_file $!\n";