in reply to recursive path function falls into infinite loop

This sub traversePath ($path) { is wrong. Perl prototypes don't do what you think they do. In fact you never introduce the argument of the function into the function. Do this instead,

use strict; use warnings; sub traversePath { my $path = shift;

$path and $npath are unintended globals, which may cause problems. I added strict.pm and warnings.pm to the mix to help you fix up whatever side effects those globals have.

File::Find is part of the core perl distribution, and I think it is silly to not use it for this. You can tell the employer I said so ;-)

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: recursive path function falls into infinite loop
by Anonymous Monk on Nov 25, 2004 at 05:36 UTC
    AAH!!! thank you! ive been messing with c++ too much lately :P and yeah, i know the no module thing is silly, but it pays the bills ::shrug::