Colin Removing some of the trees so that the wood is visible:
if ($screenOutput) { open (IN, "< $locationResponsePageSkin") or die("Cannot open: $!"); while(<IN>) { s/<!-- response here -->/$screenOutput/; print; } close IN; } HTH, Rob ----- Original Message ----- From: "Johnstone, Colin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 02, 2002 6:00 AM Subject: Regex help!! > Hi all, > > Im reading in a file line by line and I want to look for the occurence of this string > <!-- response here --> in $line. Is this the right way to do it. If it finds it it is to inser the value of $screenOutput in its place. > > if($screenOutput ne ""){ > my $responsePage = ""; > open(IN, "<$locationResponsePageSkin") or die("Cannot open: $!"); > while( my $line = <IN>){ > $line ~= s/<!-- response here -->/$screenOutput/; > $responsePage .= $line; > } > close(IN); > print $responsePage; > } > > > Colin Johnstone > Website Project Officer > Corporate Website Unit > Public Affairs Directorate > ph 9561 8643 > > -- > 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]