#!/usr/bin/perl -w

#hilite script by Roman M. Parparov <romm@empire.tau.ac.il>;

use strict;
use Term::Cap;
use vars qw($FH);

my $terminal = Tgetent Term::Cap { OSPEED => 9600 };
my $hilite = $terminal->Tputs('md',0,$FH);
my $reset  = $terminal->Tputs('me',0,$FH);
while (<STDIN>) {
    my $i = 0;
    my $c;
    while (length($c = substr($_,$i,1))) {
	if (ord($c) > 127) {
	    print $hilite;
	    print chr(ord($c) & 0x7f);
	    print $reset;
	}
	else {
	    print $c;
	}
	$i++;
    }
}
