A little while since I've played with Perl, so may be a little rusty,
but have you tried:
$input{'info'} =~ s~<br>~\n\n~igs;
i = ignore case
g = global replace
s = treat whole variable as multi-line string (effectively, ignore any
\n\n that is already in there)
Does this work?
Cheers,
Terry
-----Original Message-----
From: List for the UK HE community to discuss all aspects of managing an
institut [mailto:[log in to unmask]] On Behalf Of Cox, Will
Sent: 05 December 2001 16:49
To: [log in to unmask]
Subject: A small, but slightly annoying cgi puzzle
I'm using $input{'info'} =~ s/\<br>//g; in a cgi script to strip
line breaks out of a flat text database before sending the text as
an e-mail. Any suggestions how I would replace the <br> with a \n\n to
keep the text formatting in the e-mail.
Will
-----------------------------------------------------------------------
Will DG Cox - New Media Marketing Manager
Marketing and Development, Sheffield Hallam University
Tel 0114 225 3893 Fax 0114 225 2094 E-mail [log in to unmask]
|