#!/usr/bin/perl # print only directories from a list of files. while (<>) { chomp; print "$_\n" if -d "$_"; } exit(0);