in reply to Trying to read numbers from a text file

Using the use strict; and use warnings pragmas (something that you should always insert at the beginning of your programs) would have given you the following warnings:
Argument "(3" isn't numeric in addition (+) at ... line 8. Argument "((18" isn't numeric in addition (+) at ... line 8.
But before that, some others things would have had to be fixed in your program, especially you would have had to declare your variables with the my keyword.

Help the compiler to help you, always use strict; and use warnings;