#!/usr/bin/perl -w # Created by Ben Okopnik on Tue Feb 15 18:48:24 EST 2005 # Weird character highlighter my $a=`/usr/bin/tput -T $ENV{TERM} smso`; # Start 'standout' mode my $b=`/usr/bin/tput -T $ENV{TERM} rmso`; # End 'standout' mode my $re = qr/([^\011\012\015\040-\176])/; # "Inverted" list of valid chars while (<>){ print "Line $.: $_" if s/$re/"$a\\" . sprintf( "%03o", ord $1 ) . $b/eg; }