$item  =~ s/</&lt;/g; $item  =~ s/>/&gt;/g;

Well. It is on one line ;)

John

-----Original Message-----
From: KAVANAGH, Michael [mailto:[EMAIL PROTECTED]]
Sent: 31 January 2002 14:06
To: '[EMAIL PROTECTED]'
Subject: html entity conversion... one liner?


I thought it would be good to be able to do this:

$item = "<blah>";
$item  =~ tr/<>/(&lt;)(&gt;)/;

to convert those <> symbols to their entity references.
however, the tr operator doesn't seem to like using () to group... any
comments on how to make this operation in to a one-liner?

Thanks
Mike



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to