my $text = "$student\t $studentAge\n"; my $found = 0; while (<$fh>) { $found = 1 if $_ eq $text; }