in reply to Listing directory contents not working (SUSE Linux issue?)...

readdir returns just the directory name, not the full path. If you are not running the script from /, your -d test looks for directories in the directory you started the script from. Prepend $dir to the directory name in the test to make it work:
elsif (-d "$dir$line") {
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Listing directory contents not working (SUSE Linux issue?)...
by aquinom (Sexton) on Apr 09, 2013 at 19:57 UTC
    Thanks.

      Actually, you don't need to "chomp" the values returned by readdir.