programming-examples/perl/_Basics/Getting Input in Perl Scripts.pl

14 lines
250 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
# 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 ";
}