in reply to Globbidy glob glob glob
glob, in scalar context, acts as an iterator; it returns one result at a time and undef to signal no more results. If a single call to glob in your perl code has a variable parameter, as in your example, the actual value is only noticed the first time it's called (or the time after returning undef).
Moral: don't use glob in scalar context. Or if you do, make sure your code will always exhaust the iterator before starting a fresh iteration.
(The other possibility is that your variables are not what you think they are.)
|
|---|