in reply to Parameters for object callback

Another possibility to consider is named arguments.

Perl supports this easily by having your sub construe the argument list as "hash-like". That is, instead of     my @args = @_; you could say     my %args = @_; Then the caller could do something like

func( value => $obj_value, object => $obj, top => $top_node, affected_objects => { .... }, );
With this scheme, it is easy to have any arguments be optional, rather than having to rank their "optionalness" as in the scheme I suggested above.