in reply to How to make check process more elegant

I would probably split it into three separate subs:
checkfile "config-file" and checkdatabase "dbname" and checkfile "ini-file" and checkremote "host" or die "Check failed"