foreach (@LOOP) { my $line=$_; # Don't want to modify the orginal! $line =~ s/FNAME/$record/; $line =~ s/BANNER/@BAN/; print $line; }