sub found { open FH, "$data" or die "Can't open $data: $!"; flock (FH, 1) or die "Can't lock $data for reading"; while () { my ($username,$surname,$firstname,$secondname)=split (/\t/,$_); my $item = shift (@partners); if ($item eq $username) { print qq{$firstname $secondname $surname}; } } }