in reply to
Re^4: Using grep and glob to find directories containing file
in thread Using grep and glob to find directories containing file
Then I don't understand. If there's no anonymous array somewhere, then there's no counting going:
my $x = ('a', 'b', 'c');
Lists don't return their length in scalar context--only arrays return their length in scalar context. Although, now I see it has the same effect in your example--because in list context glob() returns an empty list when there are no matches, and trying to retrieve the last element of an empty list is undef or some other false value.