Help for this page

Select Code to Download


  1. or download this
    Input: <pre>won't escape properly - uggh!</pre>
    Desired Output: &lt;pre&gt;won't escape properly - uggh!&lt;/pre&gt;
    ...
    or
    
    &amp;lt;pre&gt;won't escape properly - uggh!&amp;lt;/pre&gt;
    
  2. or download this
    use XML::Twig;
    my $tTwig = XML::Twig->new( pretty_print => 'indented',
    ...
    my $tLog = XML::Twig::Elt->new( 'log', q(<pre>won't escape properly - 
    +uggh!</pre>) );
    $tTwig->set_root( $tLog );
    $tTwig->print;