in reply to Re^4: tree command
in thread tree command

You can use
my @dirs = glob '*/';

To get the number of files, just subtract the number of dirs from the number of everything.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^6: tree command
by Skeeve (Parson) on Oct 14, 2015 at 11:31 UTC

    Which will iterate of the files a second time and will access the file system while I iterate over an array. Or am I wrong?


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      Ouch, you're right. Doing -f wouldn't help much, either. What about
      my @all = glob '* */'; @dirs = grep m(/$), @all; # etc.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ