in reply to recursive prob with glob?

If $filename does not have a trailing slash, this could very well be an endless loop. That fits the behavior you're seeing. My guess is that you're not passing in a trailing slash on the initial call. At the very least, use File::Spec's catdir() function to concatenate path components. While most Unix filesystems, in my experience, don't care about duplicate slashes, File::Spec will clean them for you.

At best, skip the recursion yourself and use File::Find. You could also do this with readdir instead of glob, as you're asking for everything. Beware '.' and '..' though.

Replies are listed 'Best First'.
Re: Re: recursive prob with glob?
by alienhuman (Pilgrim) on Dec 29, 2001 at 00:31 UTC

    Hmm. The initial call does have a trailing slash--I've been able to verify the value of $filename using perl -d... however, I'm going to take a look at File::Find and/or readdir. Thx for the help.

    Chris

      Or the other way, you have '//' and the glob is starting from root?  Notice that the next alternative does $filename =~ s/\/$//;.

        p