The files are definitely all under 200K. They are just HTML tables reporting some data.
#!/usr/bin/perl -i.orig -p
print "this is the text you want to insert\n" if /<\/body>/;
How exactly does the -i.orig -p work? I don't think it will work corerctly for me in my case because I already have a somewhat complex command argument parser. I have a bunch of single letter (-x) options, a '-g=output_file.html' for specifying what HTML file to create or append to, and all the other arguments are various text input files. My script first runs through each file for identification information to discern what type of file it is, then calls the appropriate parser code to extract the key information I want, and repeats it for each file until I have an array of generated information.
The HTML is generated at the very end and the only way you can specify it to generate HTML and tell ti what file to print ot is with that -g option. I'd rather not read a file into a string and then manipulate the string because I have a lot of print statements that go into the output file and I don't want to have to duplicate the same code over for the string case. Thanks for the help guys.