% cat myprog use Data::Annotate; # 'Tie::Annotate'? sub adder { return $_[0] + $_[1] } my($foo, $baz) = (2, 5); annotate($foo, 'foo'); my $bar = adder($foo, $baz); say "bar is ", $bar; say "bar is annotated as ", annotation($bar); say "bar is derived from ", derivation($bar); # not sure if that should also attempt to show derivation of the # components; maybe it should take a maxdepth argument: my $etc = $bar + $foo; say "etc is annotated as ", annotation($etc); say "etc is derived from ", derivation($etc, depth => 3); % perl myprog bar is 7 bar is annotated as foo + 5 bar is derived from foo + 5 at myprog line 2 main::adder(2, 5) called at myprog line 5 etc is annotated as (foo + 5) + foo etc is derived from (foo + 5) + foo at myprog line 11 (foo + 5) at myprog line 2 main::adder(2, 5) called at myprog line 5 foo annotated at myprog line 4 %