Thank you for catching that I did not use $dir in the sub where I meant to use it.
I am not clear on what you mean by "hard-boiled style". I always either return or print at the end of a sub. (I have not gotten to use the feature say that much.) I do not know how else to end a subroutine.