note
Anonymous Monk
Thanks for the help and explanation!!! <br><br>
This behavior is certainly not obvious and it is not (clearly) documented either under 'perldoc -f glob' or at perldoc.perl.org.
The line saying "In scalar context, glob iterates through such filename expansions, returning undef when the list is
exhausted" does not make it clear (at least to me) that such a state persists across calls to glob with a new argument! In fact, I can imagine all types of unintended errors when glob has been called in a scalar context in one place and then many lines later is called again in a different context and the programmer would have no idea that the state persists.<br><br>
But then again I am not a Perl monk so these things are never obvious to me :)
1016826
1016835
5