Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
If "<" exists at the end of line, how to convert to </p> and at the begining of the line how to add <p>#!/usr/bin/perl while(<DATA>){ s/(\w*)<$/<p>$1<\/p>/g; print $_; } __DATA__ 9912290449 *In, a law prohibiting in United States went into effect.< < 9912290450
<p>9912290449 *In, a law prohibiting in United States went into effect +.</p> <p></p> 9912290450
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Add at the begining of text
by ig (Vicar) on Aug 31, 2009 at 08:50 UTC | |
|
Re: Add at the begining of text
by roboticus (Chancellor) on Aug 31, 2009 at 12:14 UTC | |
by bv (Friar) on Aug 31, 2009 at 13:10 UTC | |
by Anonymous Monk on Sep 01, 2009 at 04:10 UTC | |
by bv (Friar) on Sep 01, 2009 at 15:17 UTC | |
by Anonymous Monk on Sep 02, 2009 at 05:32 UTC |