FAQ

On Wed, 28 Mar 2001, Joe Smith wrote:

glob() should either handle recursive calls in scalar context, or it
should die() cleanly on the way back up.
The problem is that the pattern alone isn't sufficient to maintain state.
In your example, successive patterns were unique, but this won't always be
the case. The calling environment needs to provide some context to glob
so that it can distinguish between different calls even if the pattern is
the same.

Interestingly enough, File::Find::csh_glob() is all set up to accept a
second argument for context, but the core only gives csh_glob a unique
value for this argument for each glob in the op tree, not for each time
glob is called.

To get the effect you want, you could call csh_glob yourself passing it a
(unique) second argument for each level of recursion, but as you yourself
said File::Find is probably a better tool.

Cheers,
-Ben

PS. "die() cleanly" is an oxymoron.

--
signer: can't create ~/.sig: Not a directory

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedMar 29, '01 at 5:28a
activeMar 29, '01 at 6:38p
posts3
users2
websiteperl.org

2 users in discussion

Benjamin Sugars: 2 posts Joe Smith: 1 post

People

Translate

site design / logo © 2022 Grokbase