open my $out, '>', 'output.html' or die $!; print {$out} "This will be printed to the file.\n"; close $out;