my $matched; while (my $line = ) { my ($one,$two,$three,$four,$five) = split "\t",$line; if ($three eq $checkthree) { print "

With matching parameters I should be able to see this

"; $matched = 1; last; } } unless ($matched) { # this is like the else print "

If I put the else statement in it ignores the fact that the parameters match - and comes here! (But I don't know why).

"; }