in reply to Re: Get list of first level subdirectories
in thread Get list of first level subdirectories

You don't need the outer loop, because glob can take care of that implicitly. And you can also use grep instead of for to build the list:
my $dir = shift || "client"; my @list = grep -d, glob "*$dir*/*"; $" = $/; print "@list"

Replies are listed 'Best First'.
Re^3: Get list of first level subdirectories
by holli (Abbot) on Jul 21, 2005 at 15:57 UTC
    # 1 2 3 #123456789012345678901234567890123 print join"\n",grep-d,glob(shift)
    33 :)


    holli, /regexed monk/
      I knew someone wouldn't resist the temptation to golf it! ;-) But that wasn't my intention; I just wanted to make the code reasonably concise and clear (according to my definition of clear), and I also assumed that @list would be needed later in the code.