Entry
How can I convert HTML Tags to < ?
Apr 18th, 2003 08:06
Colin Thomsen, joshue moises garcia sanchez, http://www.geocities.com/jmgs2000/perlrutinas.html#5
Only, add the text to a variable, then put these code :
$linktitle =~ s/</\</g;
$linkdescrip =~ s/</\</g;
Happy programming.
For more advanced tag conversion, done automatically, use the CGI perl
module and the escapeHTML function as follows:
#!/usr/bin/perl -w
use CGI qw(:all);
$pre_text = "if (a > b) and (b < c) then print something";
$post_text = escapeHTML($pre_text);
print "$post_text\n";