use 5.010; use strict; use utf8::all; use lib "lib"; use Scalar::Annotated; my $foo = an(5, '$foo'); my $bar = an(2, '$bar'); my $baz = 2 * ($foo + $bar - 1); my $quux = $baz % $foo; say '$quux is ', $quux; say '$quux was calculated as ', $quux->derivation; # Reset the derivation of $quux, because we are no longer # interested in how it was derived. $quux->derivation = '$quux'; $quux *= 2; say '$quux is now ', $quux; say '$quux was calculated as ', $quux->derivation;