in reply to Count file lines in a directory tree

if ! exists $extList[0];

That's unusual. defined would probably be better. But I'd be inclined to write it as

if ! @extList;
or rather,
unless @extList;

We're building the house of the future together.