Apart from forking to an external process being of questionable use, your code will fail if $dirname contains a space, or a file name contains a line break; also, you cannot iterate over the list until you get it in full (could take a few minutes).
Anyway, I'm saying that using modules is usually more robust and flexible and portable than shelling out to some command.
In reply to Re^2: Traverse a directory
by Anonymous Monk
in thread Traverse a directory
by singho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |