#!/usr/bin/perl
#w3.3.pl while statement (with last).

@people = (Jim, Floyd, Fred, Jane, Marta, Jill, Sam, Joe, Alice, Andrea);

print("Please enter your name: ");
chomp($name = <STDIN>);

while (@people) {
   $try = pop(@people);
   if ($try eq $name){
      print("Yes, you can use our computer.\n");
      $success = 1;
      last;
   }					#End if statement
}					#End while

if (!$success){
   print("Sorry $name, you are not on my list.\n");   
}


__END__

