in reply to Re: How to map a directory tree to a perl hash tree
in thread How to map a directory tree to a perl hash tree

This one goes off into gah-gah land on a symlink, including an infinite recurse if the symlink points at a parent.

Just another reason to prefer File::Find.

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: Re: How to map a directory tree to a perl hash tree

Replies are listed 'Best First'.
Re: Re: Re: How to map a directory tree to a perl hash tree
by DeaconBlues (Monk) on Mar 13, 2001 at 01:35 UTC

    Sorry Randal. How about if I change the line from

    map {$dirth->{$_} = (-d "$dir/$_" ? &dirTreeHash("$dir/$_") : '')} @fi +les;

    to

    map {$dirth->{$_} = (-d "$dir/$_" ? &dirTreeHash("$dir/$_") : '') unle +ss (-l "$dir/$_")} @files;