If you're going to use seek, read the documentation, the first graf of which explains how to increment the position:
in reply to Threading two text files
Sets FILEHANDLE's position, just like the "fseek" call of
"stdio". FILEHANDLE may be an expression whose value gives the
name of the filehandle. The values for WHENCE are 0 to set the
new position *in bytes* to POSITION; 1 to set it to the current
position plus POSITION; and 2 to set it to EOF plus POSITION,
typically negative. For WHENCE you may use the constants
"SEEK_SET", "SEEK_CUR", and "SEEK_END" (start of the file,
current position, end of the file) from the Fcntl module.
Returns 1 on success, false otherwise.
Assuming your really intend to do something like this:
#1033562 (and id num_qqq.txt, idnum_exp.txt)
open(INDB, "1033562_exp.txt") or die "Can't open exp file, $!";
open(QQQ, "1033562_qqq.txt") or die "Can't open data file, $!";
my (@search, @therecs);
my $search = $_;
say "\$search at Ln28: $search";
push @search, $search;
seek(INDB, 0, 0);
my $therec = $_;
say "Both elements of \$therec at Ln36: $therec";
($ma,$id ) = split(/\t/, $therec);
push @therecs, (" $ma " . "| $id |");
my $Qpos=tell QQQ;
say "\n\t POS in QQQ: $Qpos \n";
say "\n \t array search next:";
say Dumper @search;
say "\n \t Array @therecs next:";
say Dumper @therecs;
Identifying the matches is left as an exercise to the SOPW. %hash might be an approach; so too might what you originally suggest but didn't implement-- walking the arrays in parallel. Both are well documented in threads here in the Monastery.
If you didn't program your executable by toggling in binary, it wasn't really programming!