in reply to Re^2: getting ancestors of element
in thread getting ancestors of element

See perlsub. $ means a scalar value, and

A semicolon (;) separates mandatory arguments from optional arguments.

So, sub r($$$;$) means: r is a subroutine prototyped to take at least 3, and at most 4, scalar arguments.

Hope that helps,

Athanasius <°(((><contra mundum