Playing with the total function

Doesn’t work. Not sure why. Perl is annoying.