open(my $Raw_fh, ">", "Output_Raw.txt") or file_open_error_abort("Output_Raw.txt"); # This subroutine will print a file open error message, including the filename passed to it, and terminate the program after an acknowledgement from the user. sub file_open_error_abort { my $filename = $_[0]; say "Cannot open \"$filename\": $!."; print "---Press Enter to quit---"; my $pause = ; exit; }