#!/usr/bin/perl -w use CGI; my $cgi = new CGI; my $string = ' This has many funny chars: \n a=3.5! a;b - Go -> 2 "a" .'; print $cgi->header, $cgi->start_html; print "A string with some funny characters :
\n", "
\n",
  $cgi->escapeHTML($string),
  "

\n"; print "It would look like this in a url:
\n", "
\n",
  $cgi->escapeHTML( $cgi->escape($string) ),
  "

\n"; print "And here's what it looks like as html:
\n", "
\n",
  $cgi->escapeHTML( $cgi->escapeHTML($string) ),
  "

\n"; print "

(Are we having fun yet? )\n"; print $cgi->end_html;