my $output_file = 'demo.txt'; open(my $out_fh, '>', $output_file) or die "Cannot open file '$output_file' for writing: $!";