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.
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";
}
...
Note Perl arrays start with index 0 as the first element, so $numbers
3 is the fourth number. You'll get used to it.
Cheers,
R.
Pereant, qui ante nos nostra dixerunt!