If that's all your script prints then you have serious problems. You have a lot of print statements and very little output. But then I don't see any hdl_* subroutines so maybe that's your problem. Or maybe your input to one of the functions is not what you think it is. Or maybe there's a problem on line 42.