in reply to Unshift and push inside of map operation.
map and also foreach don't well work with changing arrays. You might use something like this:
while (@a) { $dirtocheck= shift @a; ($dirs,$files)= vendorprogram($dirtocheck); unshift @a,@$dirs; push @result,$dirtocheck,@$files }
This would give you a list of all the dirs and files the vendorprogram finds ordered depth first.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unshift and push inside of map operation.
by ikegami (Patriarch) on Sep 23, 2008 at 04:13 UTC | |
by tye (Sage) on Sep 23, 2008 at 04:57 UTC | |
by jethro (Monsignor) on Sep 23, 2008 at 04:23 UTC | |
by ikegami (Patriarch) on Sep 23, 2008 at 04:30 UTC | |
by dave_the_m (Monsignor) on Sep 23, 2008 at 12:39 UTC |