in reply to ls piped tpo perl -pe runs indefintely

You don't need xargs:
ls | perl -nE'chomp; say $_ if -d $_'
neither you need ls:
perl -E'for (<*>) {say $_ if -d $_}'

Replies are listed 'Best First'.
Re^2: ls piped tpo perl -pe runs indefintely
by ISAI student (Scribe) on May 01, 2012 at 16:26 UTC
    Many thanks. It works, and has taught me a lot.
Re^2: ls piped tpo perl -pe runs indefintely
by Anonymous Monk on May 01, 2012 at 16:30 UTC

    Maybe a bit more clear:

    perl -E'for (@ARGV) { say $_ if -d $_}' *