in reply to Perl SQL substitution pain!

I could be totally wrong, but are you sure you want to replace ALL of them in the first loop? Like here is what I'm seeing as you're going through.
while($row = $sth->fetchrow_arrayref) { #pick up the first row as an array ref $Replacement[12]=$row->[0]; #at this point you have one item from the sql query in your #Replacement array $Kine=~s/FLF(\d\d)/$Replacement[$1]/ge; #replace all of them items in $Kine

Because you are using the /g qualifier at the end of your regular expression, it's going to hit absolutely everything in the loop, regardless of whether the SQL loads it first or not. There isn't any qualifier on the regex as to what to match, except _any_ two digits. After that point all of your FLF's have been transformed, so it's done matching. You may consider restructuring your loop or your regular expression to more closely match what you receive in $row->[0], which ever you feel more comfortable doing.

The previous example works only because they start with all of the data going into the regex, where as you do not.

Hope this helps.

    --jb