in reply to recursive dir and file

you're passing to the recursive function a scalar, but in the function you treat it as a list (@_) instead of a simple (shift). assigning a list in scalar context assigns the count of the list to the variable instead of the value of the first list element.
the hardest line to type correctly is: stty erase ^H