open (my $FILE, '<',"res.txt") or die $! ; while (<$FILE>){ chomp; my ($foo,$bar) = split /\+/, $_, 2; print $foo + $bar,"\n";}