http://www.perlmonks.org?node_id=972545


in reply to Re: listing all subdirectories of directory into file
in thread listing all subdirectories of directory into file

A slightly simpler approach than jdrago999's above is to use these built-in perl functions to achieve your objective:

Do you think? I think File::Find would be the simpler approach... it does a lot for you. I'd do it something like this (untested):

#!/usr/bin/perl use warnings; use strict; use File::Find; use Cwd qw(abs_path); sub w { -d && print $File::Find::name,$/ } File::Find::find( {wanted=>\&w}, abs_path($_)) for @ARGV;

-sauoq
"My two cents aren't worth a dime.";