Moving one function (more later) from bc-nagios-test.pl to bclib.pl as some of these can be useful elsewhere