use strict; use warnings; my $line1 = <>; my $line2 = <>; chomp ($line1,$line2); my ($A,$B) = split /\s/, $line1; print join " " , $A + $B, $line2;