in reply to Re^4: Subroutine help
in thread Subroutine help

I was not clear; sorry.

You specify my $sum = AddNumbers( 1, 2, 3, 4, 5, 6 ); As a result, you will always get 21 as an answer.

If you ever hope to see a different answer, you need to specify six variables (or an array of values). In order to do that, you need to prompt the user for the values, and then inout those values.

If you want us to help you fix the software that does that, you need to show us the software first. The code you reposted does not prompt the user, neither does it input anything.