use 5.010; # just for say(); use strict; use warnings; { package Annotated; sub new { my $class = shift; bless \@_, $class; } sub value { $_[0][0] }; sub annotation { $_[0][1] }; use overload '+' => sub { Annotated->new( $_[0]->value + $_[1]->value, "(" . $_[0]->annotation . ' + '. $_[1]->annotation. ')' ); } } my $foo = Annotated->new(2, 'foo'); my $bar = Annotated->new(5, 'bar'); say +($foo + $bar)->value; say +($foo + $bar)->annotation; __END__ 7 (foo + bar)