in reply to Re: Execution hangs on File::Find
in thread Execution hangs on File::Find

thank you for the inputs. I did make the optimization you indicated in traversing only once - good find. i also added the logging within the sub routine but still indicates it is stuck on the top level directory & never traverse it. I have the same number of files locally & in the network share so im certain it is not the number of files. i was thinking i need to add network authentication on my code but then i thought mapped drive should be like local drive as i've already entered the network credentials to create the drive mapping.

Replies are listed 'Best First'.
Re^3: Execution hangs on File::Find
by Eily (Monsignor) on Dec 04, 2017 at 13:24 UTC

    Well, add more logs to find precisely where you are stuck:

    sub wanted { $logger->debug("Reached $File::Find::name"); $logger->info(Carp::longmess("TRACE2")); if (-f $File::Find::name) { $logger->debug("This is a file: checking time"); stat($File::Find::name)->mtime > $lastepoch or return; push @files,$File::Find::name; } else { $logger->debug("Not a file"); if (-d $File::Find::name) { $logger->debug("This is a directory"); push @todel,$File::Find::name; } else { $logger->debug("Not a directory"); } } $logger->debug("Exiting"); }
    BTW, /\.*$/ means that the name must have 0 or more dots at the end. This is true for all strings so this test is useless.