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