use 5.010; use strict; use warnings; my $x = {foo => "abc"}; { package ChocolateSauce; use overload '.' => \&whipped_cream; sub whipped_cream { my ($adam, $eve) = @_[$_[2] ? (1, 0) : (0, 1)]; $$adam{$_} = $$eve{$_} for keys %$eve; $adam; } } bless $x => 'ChocolateSauce'; $x .= {bar => 'def', baz => 'ghi'}; while (my ($k, $v) = each %$x) { say "$k => $v"; } __END__ bar => def baz => ghi foo => abc