in reply to Looping through MySQL
You're also treating @info as both a global and a return value (from each level of the recursion). I think that's not what you indend.
This is pretty easy to debug. Each time you push a value onto @info, print $name, $parent, and the value that you're pushing. Then ponder carefully just how it is that those values are what they are. For extra learning potential, do this on paper before you run the script, and compare your paper results with what gets printed.
|
|---|