in reply to simple question on next line parameter

I would like to have a blank line in between line 2 and 3. where can I place the "\n" in my code so the outout will be like below?

If you wish to continue assuming each match will occur only once and in order, you could do

while (<OUTFILE>) { print FINAL $_ if /(my first line)/; print FINAL "$_\n" if /(my second line)/; print FINAL $_ if /(my third line)/; }

I was successful till that point but my outfile.html has "br" at the end of each line as shown below.

s/<br>$//;

Replies are listed 'Best First'.
Re^2: simple question on next line parameter
by yskmonk (Initiate) on May 19, 2009 at 13:25 UTC

    Thanks for your replies. I could figure out how to include new line but I am still stuck with how to remove the  <br> at the end of each line

    ikegami: you mentioned in the previous post to include

    s/<br>$//;
    where do I include that in my code? Please Advise experts!! Thanks again
      Wherever you want to remove the trailing <br>.

      It operates on $_ unless you bind another variable (using =~) to the s/// operator.