[Perl] Dir structure

Gabor Szabo gabor at tracert.com
Mon Jan 28 03:20:58 PST 2002

On 2002.01.28 12:20 Yaron Golan wrote:
> Hi all,
> Do you know (or have) where can I find a script that gets a root
> directory
> and prints its directory structure under it?

a simple example for this:

use File::Find;

unless (@ARGV) {
   push @ARGV, ".";

find (\&tree, @ARGV);

sub tree {
    #print "$_\n";
    print "$File::Find::name\n";
-- Gabor

Gabor Szabo

Perl Training Israel
Phone: +972-8-973-2225 x 101

More information about the Perl mailing list