CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:



Mar 17, 2000, 5:20 AM

Post #1 of 3 (1491 views)
output Can't Post

Hi everybody
look at this :
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

$reply = "<table width=\"502\" border=\"0\" cellspacing=\"2\" cellpadding=\"5\"><tr> <td width=\"166\" rowspan=\"3\" valign=\"top\" bgcolor=\"#0085A6\"><b><font color=\"#FFFFFF\">$nom</font></b></td><td width=\"310\" bgcolor=\"#00A5CE\"><i><b>$email</b></i></td></tr><tr><td width=\"310\" height=\"9\" rowspan=\"2\" valign=\"top\" bgcolor=\"#00A5CE\"> <p><font color=\"#FFFFFF\">$message</font></p></td></tr><tr></tr></table>\n<!--Reply here-->";

open (re, "<$count.html") or dienice("Couldn't open: $!");
$data = <re>;
close (re);
$data =~ s/<!--Reply here-->/$reply/;
open (fin, ">$count.html") or dienice("Couldn't open: $!");
print fin $data;
close (fin);
instead of having $reply in the place of the comment I have this:
<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

<table width="502" border="0" cellspacing="2" cellpadding="5">
what's wrong

[This message has been edited by jumaru (edited 03-17-2000).]

Administrator / Moderator

Mar 22, 2000, 4:32 AM

Post #2 of 3 (1491 views)
Re: output [In reply to] Can't Post

Unless I'm missing something, $data is your count and $reply contains the code you wish to perform the substitution on. Assuming that $data also contains a <!--Reply Here-->, and may have more than one line, add a m at the end of your regex:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>

$data =~ s/<!--Reply here-->/$reply/m;

which will tell your regex to look across multiple lines.

Hope this helps!


Mar 22, 2000, 5:22 AM

Post #3 of 3 (1491 views)
Re: output [In reply to] Can't Post

Thanks Jasmine, I'm gonna try it now


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives