#!/usr/bin/perl -w use Term::ANSIColor; my $col = shift(@ARGV); my $wang = shift(@ARGV); unless(defined $wang) { $wang = $col; $col = 'blue'; } $on = color($col); $off = color('reset'); while(my $line = <>) { $line =~ s/($wang)/${on}$1${off}/g; print $line; }