open my $output, '>', q{C:\Program Files\cron\Cruise Ships\ship_data.csv}; # and later print {$output} $input;