#this wil cover strings and input from user #!/usr/bin/perl use strict; my ($string, $word, $evil, $question); $question = "Where do you want to go today? \n"; #you can assign strings to a scalar with the =. $word = "Linux"; $evil = "Microsoft"; print $question; chomp($string = ); #this is how you get a line of input from the user; if($string eq $word) #this shows an if statement, { # as well as the eq operator, which is equality for strings. print "Good answer \n"; } elsif($string eq $evil) { print "WRONG!\n"; } else { print "Get a clue.\n"; } #the eq is the equals operator, there is also alot of other string operators, I'll only go over some. #concatenation operator; $string = $evil . "Sucks"; #note $string now hold the string "MicrosoftSucks" print $string; #this operator is stressed a lot in the book but i dont use it too much; chomp($string); #this will remove the newline char from the end of a string. #heres a good one we mentioned in class my @values = split " ", $string; #this will split the string into the array values. #The " " denotes to split the string on a space.