open(OLD,"<$dir/$file") or die "can't open $dir/$file: $!"; #### my $data = do {local $/; }; # slurp the whole file in to $data my @replace_list = ('','Notes:','Director:','Actors:'); while ($data =~ s/(?<=$search)/shift @replace_list/egs) {};