in reply to Re^2: exit this way
in thread exit this way

Well, you’re right. Right in the same way that there is no particular reason use strict; is necessary to working code. An exit; or exit 0; between your code and your subs is an excellent practice and can prevent goofy and accidental bugs.

Replies are listed 'Best First'.
Re^4: exit this way
by stevieb (Canon) on Aug 31, 2015 at 22:41 UTC

    I've never heard this before, but I'm always open to change my understanding/belief when something better comes along. Do you have any of these particular issues in mind that you speak of?

      Just what I said; completeness, avoiding accidental code being run somewhere left out, separation of concerns in the script, you know where the main logic ends without reading 1,000 lines of subroutines; I’ve been doing it for 15 years and it’s served me well. Consider closing filehandles—unnecessary, but also a good idea.

        I’ve been doing it for 15 years and it’s served me well.

        Me too. Yep, about 15 years. :)

        Well, I'd been doing it for a while before posting about it 15 years ago. The link includes some explanations about why I did. And, yes, I still do it.

        - tye