Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

#!/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}
How to add the <p> tags output should look like
{NEW} <p>Hi How r u </p><p> I am doing fine </p> {OLD} <p> Hi How r u </p>
Please anyone help me out

Replies are listed 'Best First'.
Re: adding tags to text
by moritz (Cardinal) on Sep 02, 2009 at 06:20 UTC