#!/usr/sbin/perl
@words = ("jethro","grace","sossity");
print "What is your name?\n";
$name = <STDIN>;
chop ($name);
if ($name eq "Deepak") {
print "Hello $name We have been expecting you\n";
}
else {
print "Hello $name , what is the password\n";
$guess = <STDIN>;
chop ($guess);
$i=0;
$correct = "maybe";
while ($correct eq "maybe") {
if ($words[$i] eq $guess) {
$correct = "yes";
} 
elsif ($i < 2) {
$i = $i+1;
} 
else {
print "Wrong Try again";
$guess = <STDIN>;
chop ($guess);
$i=0;
}
}
}
