Thank you, that worked! :) By the way, I'm thinking of a new thing that I want to do. How would I alter this to open another page the same way, but replace the html code BETWEEN two "<!--news feed-->" with the same $html? I could rename the second "<!--news feed-->" if that would be easier. But I'm looking at regexes to do this, but I'm not real good with them. This won't be just text, it won't be just digits, etc. It would be a combination of everything. (complete HTML coding)
Any ideas on this one? Or should I start a new topic? Thanks again! -----Original Message----- From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 10:34 PM To: [EMAIL PROTECTED] Subject: Re: Searching for a specific spot on a page Do it this way if( open(IN,$file)) { local($/)=undef; $filestr = <IN>; } close IN; $SEARCH = '<!--news feed-->'; $filestr=~s/$SEARCH/$SEARCH $HTML/; open(OUT,">$file") || die "$!"; print OUT $filestr; close OUT; Troy May wrote: > Hello, > > I'm trying to do a news feed type of script from an admin page. I need to > open up a page and find the line that starts with "<!--news feed-->" and > insert "$html" right after that. I'm drawing a blank on how to search for > that line. This is probably easy, but I can't think of how to do it. > > Thanks in advance! > > Troy > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]