programming-examples/perl/Basics/Getting Input in Perl Scripts.pl
2019-11-18 14:44:36 +01:00

14 lines
250 B
Perl

# Note the extra space after the question mark.
print "What is your favorite scripting language? ";
$subLang = <STDIN>;
chomp($subLang);
if ( $subLang eq "perl" ) {
print "you chose perl!\n";
} else {
print "$subLang ";
}