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"; }