No, toolic wasn’t referring to the $paths in your
if (defined $paths){
test, but rather to the two “paths” variables in scope at sub dir_listing — @paths and $paths, which are entirely separate variables (except that they happen to share the same name after the sigil). The first is an array, which is never used; the second is a scalar, which you are treating as an array reference.
See the code by Anonymous Monk, below, for the correct way of declaring and using these variables.
Athanasius <°(((>< contra mundum
|