#!/usr/bin/perl -w
use strict;
my $s;
print join '', map { 
  $s = $_; $s =~ s/&/&amp;/g; $s =~ s/</&lt;/g; 
  $s =~ s/>/&gt;/g; $s =~ s/  /&nbsp;&nbsp;/g; $s 
} <>;

