Perl: How to “die” with no error message?
问题 I run a simple file test in perl with the code below: my $f1 = "$pre_file"; unless (-e $1) { print "\n Pre_check file does not exists! \n"; die; } It prints the following output: Pre_check file does not exists! Died at ./huawei-postcheck line 81. However I do not want the last line "Died at ./huawei-postcheck line 81.". I want to to "die" with no error message. Is it possible? 回答1: You could just say die "\n"; to suppress the message. 回答2: See the documentation for die. If the last element of