in reply to glob behavior
In scalar context (your second example), glob will iterate over the items that match -- one item per call, and return undef if no more items remain. In list context (your first example), glob will return the entire list of items that matched, and that list could possibly be empty.
So your two examples do differ in the context in which glob is being called, and that is documented to provide different behavior. Essentially, in scalar context glob acts like an iterator. In list context it doesn't iterate; it just returns a list.
What I can't explain is why the list would be empty if nothing else changed.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: glob behavior
by rovf (Priest) on Mar 20, 2012 at 08:34 UTC | |
by vagabonding electron (Curate) on Mar 20, 2012 at 08:56 UTC | |
|
Re^2: glob behavior
by vagabonding electron (Curate) on Mar 20, 2012 at 09:34 UTC |