sub sum { return 0 unless @_; my ($h, @t) = @_; return $h + sum(@t); } sub length { return 0 unless @_; shift; return 1 + length(@_); }