in reply to Perl compare
You already have some great advice on fixing your code. There is one thing I would like to add. When you have a construct like this: my ($number1,$number2,$number3,$number4) = split /\t/; it is time to learn about arrays.
Note Perl arrays start with index 0 as the first element, so $numbers3 is the fourth number. You'll get used to it.use strict; use warnings; ... my @numbers = split /\t/; if ($number[3] == 42) { print "I got the answer\n"; } else { print "What was the question?\n"; } ...
Cheers,
R.
|
|---|