#!/usr/bin/perl $filename = "test.txt"; $termsfile = "test.list"; open filename or die "Can't find file $filename: $!\n"; @terms = `cat test.list`; foreach (@terms) { chomp; } $count = 1; while (read filename, $buf, 16384) { @buf1[$count] = $buf; $count++; } foreach $term (@terms) { ($search, $replace, $junk) = split /\#\#SPLIT\#\#/, $term; print STDOUT $search; print STDOUT $replace; print "\n"; foreach $buf2 (@buf1) { $buf2 =~ s/$search/$replace/g; } } print STDOUT @buf1; close filename;