Code:#!/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 depression then. < felt she was replacing me as mother and grandmother.
From the above code the output is below.
But I have to print the line, such that it does substitutionCode:This affected me deeply because </p><p> I was being treated for depression then. </p><p> felt she was replacing me as mother and grandmother.
Code:<span><p>This affected me deeply because </p><p> I was being treated for depression then. </p><p> felt she was replacing me as mother and grandmother.




Bookmarks