view message_tie.pl @ 1087:5008714a9eb8

added message_tie.pl
author thomask
date Wed, 19 Jul 2006 12:31:37 +0000
parents
children 7269c8972179
line wrap: on
line source

#!/usr/bin/perl

my $message_pattern = shift;
my $last_cmd;

while (<>) {
	if ($_ =~ /^(run|norun|compile|nocompile): (.*)/){
		$last_cmd = $2;
	}
	if(/$message_pattern/) {
		print "$last_cmd\n$_\n";
	}
}