in reply to Unknown File Operation

Looking at the code, it opens D:/MON/3800-128.html, reads it into memory, creates a copy replacing 'onClick' with 'HREF' and writes this to screen and to the file 0071.html. It then unlinks 0071.html which deletes the file. Not sure what the point is of deleting a file you've just created but hey ho...

Your code is a bit confusing and I think that is probably not helping. Can you describe exactly what you are after? My guess is the following:
  • Copy 3800-128.html over 0071.html replacing html onClick with HREF.
  • Replace 3800-128.html with 2800-129.html (no change of html)
  • Replace 3800-129.html with 2800-130.html (no change of html)
  • Replace 3800-130.html with 2800-131.html (no change of html)

  • The following code should do the same as your original but without the memory load of copying the entire input file into memory...
    foreach my $q (128..131){ # open the files # the input file open( FILE, "<D:/MON/3800-$q.html" ); # the output file open( MYFILE, '>0071.html' ); # do the replacement and output the results to MYFILE while (my $line = <FILE>){ $line =~ s/onClick/HREF/isg; print MYFILE $line; print $line; } print MYFILE '<br/>'; print '<br/><br/><br/>'; # close the files close(MYFILE); close(FILE); unlink("0071.html"); }