in reply to removing <br> from my output

Try this...
#!/usr/bin/perl use strict; while (<DATA>) { s/<br>$//; print if /(line[123])/; } __DATA__ line4<br> line1<br> test<br> line2<br> line3<br>

Replies are listed 'Best First'.
Re^2: removing <br> from my output
by Anonymous Monk on May 20, 2009 at 14:10 UTC
    Non of the above suggested methods are working... Please advise me further on this Thanks!
      yskmonk? Is that you? yskmonk said repeately that it is working for him.
        yskmonk:
        #!/usr/bin/perl use strict; use warnings; my $outfile="out.html"; my $final="final.txt"; open OUTFILE, "<$outfile"; open FINAL, ">$final"; while (<OUTFILE>) { s/<br>//gi; print FINAL if /(line\d*=(\d|[A-Za-z]{3}\s).)/; }
        Input File: (out.html)
        line1=10 line3=20 line3=30 line4=Mon May 18 02:28:58 EDT 2009 line5=60 line6=Mon May 18 02:28:58 EDT 2009 line7=Mon May 18 02:28:58 EDT 2009 line8=Mon May 18 02:28:58 EDT 2009 line20=Mon May 18 02:28:58 EDT 2009 line30=60 line40=Jambalaya #erroneous input, should not print to +final.txt line100=45 line 200=Mon May 18 02:27:58 EDT 2009 line1000=Mon May 18 02:28:58 EDT 2009 line1001=90 line 2000=Mon May 18 02:28:58 EDT 2009 #erroneous input, shoul +d not print to final.txt line2001=100 line10000=50 line10001=Mon May 18 02:28:58 EDT 2009
        Output file (final.txt):
        line1=10 line3=20 line3=30 line4=Mon May 18 02:28:58 EDT 2009 line5=60 line6=Mon May 18 02:28:58 EDT 2009 line7=Mon May 18 02:28:58 EDT 2009 line8=Mon May 18 02:28:58 EDT 2009 line20=Mon May 18 02:28:58 EDT 2009 line30=60 line100=45 line1000=Mon May 18 02:28:58 EDT 2009 line1001=90 line2001=100 line10000=50 line10001=Mon May 18 02:28:58 EDT 2009
        Note: This does not take care of removing duplicates