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]