programming-examples/perl/String/A very simple password checker.pl

13 lines
307 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/local/bin/perl
print ("Enter the secret password:\n");
$password = "bluejays";
$inputline = <STDIN>;
chop ($inputline);
$outputline = $inputline eq $password ?
"Yes, that is the correct password!\n" :
"No, that is not the correct password.\n";
print ($outputline);