in reply to Re: substitute character
in thread substitute character
suppose the input is like above specified. How to print the full line with substitution of <p> tags. Now the above code prints like#!/usr/bin/perl my $line; while (my $line = <DATA>){ if($line =~ m/<span><p>(.*)/){ $line= $1; $line =~ s/</<\/p><p>/g; print $line; } } __DATA__ <span><p>This affected me deeply because < I was being treated for dep +ression then. < felt she was replacing me as mother and grandmother.
But I want the line similar to thisThis affected me deeply because </p><p> I was being treated for depres +sion then. </p><p> felt she was replacing me as mother and grandmothe +r.
<span><p>This affected me deeply because </p><p> I was being treated f +or depression then. </p><p> felt she was replacing me as mother and g +randmother.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: substitute character
by arun_kom (Monk) on Sep 02, 2009 at 09:18 UTC | |
by gem555 (Acolyte) on Sep 02, 2009 at 09:29 UTC | |
by Corion (Patriarch) on Sep 02, 2009 at 09:36 UTC | |
by gem555 (Acolyte) on Sep 02, 2009 at 09:56 UTC | |
|