How to terminate a program in Perl - exit or die?

后端 未结 3 1429
隐瞒了意图╮
隐瞒了意图╮ 2021-02-05 02:08

I am using syntax checking to see whether my Perl script is being used in the correct way. If the syntax is not correct, I display a message saying what the correct syntax is, a

3条回答
  •  一整个雨季
    2021-02-05 03:02

    It is best to follow existing practice ("rule of least surprise"): exit with 2 on a fatal error such as a syntax error.

提交回复
热议问题