in reply to Substitution problem.

You think you're using quotemeta, but you aren't. Instead, you are telling Perl to look for a string that begins with a q followed by a u and soforth. Perl does not evaluate arbitrary expressions on the left side of s///.

Try this:

for $count (0..52) { my $pattern = quotemeta($array1{$count}); $sometext =~ s/$pattern/$array2{$count}/g; }
Or (does the same thing):
for $count (0..52) { $sometext =~ s/\Q$array1{$count}/$array2{$count}/g; }
Notice also: No ' single quotes around variable names, because single quotes prevent variables from being interpolated. Also no quotemeta on the right side, because it is not necessary.