Your changing the data in @LOOP during the first iteration
of the outermost loop. After the first iteration, there's nothing left to substitute. You need to change the inner loop to something like this so that you're changing copies of the data in @LOOP, rather than @LOOP itself:
foreach (@LOOP) {
my $line = $_;
$line =~ s/FNAME/$record/;
$line =~ s/BANNER/@BAN/;
print $line
}
I am also tempted to say
use strict and warnings, but
I'll refrain for now :)