Have an idea?

Unverified Perl - Adding values together from a numeric grid

I want to add values together to get a total from a numeric grid. Then, based on that total, output a result. For instance, if the value of Row 1 + the value of Row 2 = 1, output $24,000.... How do I add values together using unverified perl? Thanks.