programming-examples/perl/String/Read input lines and concatenate them.pl
2019-11-15 12:59:38 +01:00

14 lines
323 B
Perl

#!/usr/local/bin/perl
$resultstring = "";
print("Enter your input - type an empty line to quit\n");
$input = <STDIN>;
chop ($input);
while ($input ne "") {
$resultstring .= $input;
$input = <STDIN>;
chop ($input);
}
print ("Here is the final string:\n");
print ("$resultstring\n");