Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Update:
Roger pointed out some gross errors. Sorry! Fixed now! Well, other than a few errors, you're on your way. I'll do a line by line on this baby and see what I think. Do you mean to be inconsistent here? Or should "UL" be "<UL>"? Your open is clobbering index.html. Not what you want. Also, you never write out to the file to actually change it in memory. Try while (<FILE>) { :) Here's where you have your real problems. The if statement compares the file line to the number of items in @codes. Probably not what you want. Also, eq won't work unless you have only one word per line. Also probably not what you want. Way to go. I would rewrite it like this: Call it with the filename as argument. Of course, this is still horribly simple minded because it breaks on constructs like <P class="hi">. Good luck fixing that with a simple regex. In reply to Re: substuting a whole file
by jweed
|
|