in reply to Sort path strings by component count.

Would defining
sub lenkf { return scalar @_ }
and using lenkf split .. instead of scalar split .. work?