Using ne in if statement : Comparison Operators « Language Basics « Perl
- Perl
- Language Basics
- Comparison Operators
Using ne in if statement
#!/usr/bin/perl -w
use strict;
my $password = "foxtrot";
print "Enter the password: ";
my $guess = <STDIN>;
chomp $guess;
if ($password ne $guess) {
die "Go away, imposter!\n";
}
Related examples in the same category