in reply to Re: somewhat OT: Subroutines within if statements
in thread Subroutines within if statements

In fact you probably shouldn't use exit 0 for an error at all. Better to use die $message instead.

Giving a non-zero exit code (as die() does) on error makes combining scripts in shell scripts / one-liners a lot easier:

my-shell$ check-this-config-file.pl && then-stop-this-server && then-d +o-a-lot-of-stuff.pl && then-start-that-server
And yes I do this a lot.