sub apply { my ($val, $func, @etc) = @_; if (@etc) { return (apply ($func->($val), @etc)); } else { return ($func->($val)); } }