Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How to add the <p> tags output should look like#!/usr/bin/perl while(<DATA>){ if (/^({\w+})/) { $f = $1; } if ($f =~ m/({NEW}|{OLD})/ ) { print $_; } } __DATA__ {NEW} Hi How r u < I am doing fine < {OLD} Hi How r u < {OLDAGE}
Please anyone help me out{NEW} <p>Hi How r u </p><p> I am doing fine </p> {OLD} <p> Hi How r u </p>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: adding tags to text
by moritz (Cardinal) on Sep 02, 2009 at 06:20 UTC |