in reply to calling sub and returning value from the same line

That work only if your  error function returns a true value.
Boris