foreach my $q (128..131){ # open the files # the input file open( FILE, "0071.html' ); # do the replacement and output the results to MYFILE while (my $line = ){ $line =~ s/onClick/HREF/isg; print MYFILE $line; print $line; } print MYFILE '
'; print '


'; # close the files close(MYFILE); close(FILE); unlink("0071.html"); }