The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
wow.. vey good point.. thanks Laurent_R.
The central point, as many times, is a correct understanding of words and semantic they cover. This can be useful for the OP and for other as me that have missed this difference (from wikipedia):
but.. ..the logic of the snippet IS recursive in the way it populates @dirs: in fact it iterates over a list updated dynamically while processing the iteration itself. It produes a directory tree, or well a list of different depth objects. Also here the problem is divided in small pieces to process. But in the opposite way: @dirs starts populated by the root node only and while it is processed the stack @dirs itself it is updated: the way @dirs is populated by push seems recursive, in a broad sense. In other words, as wikipedia tell us some line below: Recursion and iteration are equally expressive: recursion can be replaced by iteration with an explicit stack, while iteration can be replaced with tail recursion. Hth L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS. In reply to Re^3: Recursive Directory print
by Discipulus
|
|