in reply to •Re: problems returning from recursive subroutine
in thread problems returning from recursive subroutine

Without knowing more about the context, it's hard to say whether following symlink is appropriate or not. For all we know, your solution is wrong because it improperly does not follow symlinks, which means part of the directory structure isn't updated.

Abigail

  • Comment on Re: problems returning from recursive subroutine

Replies are listed 'Best First'.
•Re: Re: problems returning from recursive subroutine
by merlyn (Sage) on Apr 18, 2003 at 11:48 UTC
    If symlinks must be followed, then still the safest is to use modern technology:
    use File::Find; finddepth { wanted => sub { return if /^\./; my $new = lc $_; return if $new eq $_ or -e $new; rename $_, $new or warn "Cannot rename $File::Find::name to $File: +:Find::dir/$new: $!"; }, follow => 1, }, $ARGV[0] || ".";

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.