#!/usr/bin/perl use warnings; use strict; use File::Find; die "Specify path to search as first argument to the script\n" unless @ARGV; find(\&wanted, $ARGV[0]); sub wanted { print "$_\n" if (-d $File::Find::name && /\s/); }