http://qs321.pair.com?node_id=1016883


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:

use 5.012; my $x = ('a', 'b', 'c'); say $x; --output:-- '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.