in reply to Procesing directories

You could "fix" this code by localizing your directory handle: local(*TMP_D);

But, really, why aren't you using File::Find?

Replies are listed 'Best First'.
Re: Procesing directories
by lemming (Priest) on Jan 05, 2001 at 07:11 UTC
    I think more than localizing the dir handle is needed to get it to work.
    Fastolfe already gave the best answer.
    Now some other trouble with the original code
    if ($tmp =~ /\.\.?/) { next; }
    This will skip any file with one or two periods. This might cause trouble at the mill.
    $tmp = "$dir/$tmp"; if ($tmp =~ /^(\w*)\.(jpg|jpeg)$/)
    \w will only match letters and _. You put a / in.