Perl Breaking out of an If statement

后端 未结 7 847
深忆病人
深忆病人 2021-02-05 03:50

This one just came up: How do I break out of an if statement? I have a long if statement, but there is one situation where I can break out of it early on.

In

7条回答
  •  清歌不尽
    2021-02-05 04:02

    You could put the rest of your if block inside another if statement, like this:

    if (some_condition) {
        blah, blah, blah
        if (!$some_other_condition) {
            blah, blah, blah
            ...
        }
    }
    

提交回复
热议问题