A+B: Difference between revisions

Content added Content deleted
Line 2,682: Line 2,682:
=={{header|Perl}}==
=={{header|Perl}}==
<lang Perl>my ($a,$b) = split(' ', scalar(<STDIN>));
<lang Perl>my ($a,$b) = split(' ', scalar(<STDIN>));
print "$a $b " . ($a + $b) . "\n";</lang>
print "$a $b " . ($a + $b) . "\n";

# Or using The List::Util module and a modern perl...
# Or using The List::Util module and a modern perl...
say sum split /\s+/, scalar <STDIN>;
say sum split /\s+/, scalar <STDIN>;</lang>


=={{header|Perl 6}}==
=={{header|Perl 6}}==