use List::Util qw[ reduce ]; print reduce{ eval "$a + $b" } 1,2,3; Use of uninitialized value in concatenation (.) or string at ... 3