# "E:\My Vaults\My Vault\Perl\happy.pl" # Displays a warm greeting. print "What is your name? "; my $name = ; chomp($name); print "Hello, $name! I am a computer! Austin is my author! He created this Perl quiz!\n"; # User greets the computer. print "Please greet me so I know I am welcome.\n"; my $greet = ; # Displays difference between ages. chomp($greet); print "$greet to you, too. What year were you born in, $name? "; my $dob = ; if (($dob eq '')) { print "Hey! Why won't you answer?\n"; } if (($dob < 1996)) { my $difference = 1997 - $dob; chomp($difference); print "You are $difference years older than my author, Austin.\n"; } if (($dob > 1998)) { my $difference = $dob - 1997; chomp($difference); print "You are $difference years younger than my author, Austin.\n"; } if (($dob == 1998)) { my $difference = $dob - 1997; chomp($difference); print "You are $difference year younger than my author, Austin.\n"; } if (($dob == 1996)) { my $difference = 1997 - $dob; chomp($difference); print "You are $difference year older than my author, Austin.\n"; } if (($dob == 1997)) { print "You are the same age as my author, Austin!\n"; } # Asks favorite color. print "How many people live in your house with you? "; my $housenum = ; if (($housenum == 5)) { print "5 people live in my author's house, too!\n"; } if (($housenum != 5)) { print "Oh. There are 5 people living in my author's house.\n"; } chomp($name); print "Good bye, $name!\n";