Perl is not doing that... I am guessing you are redirecting the output on error?
Maybe try returning undef instead of $Retcode on error?
How is this script being executed, manually?
Another possibility is that the SCMTools::Util module is outputting to a log file when it encounters an error. Difficult to tell without see the code of that module.