view message_tie.pl @ 1440:5224177dd804

r7388@birke: tk | 2007-03-29 15:55:00 +0200 is -> static is
author thomask
date Sat, 31 Mar 2007 08:25:50 +0000
parents 7269c8972179
children
line wrap: on
line source

#!/usr/bin/perl

use strict;
use warnings;

my $message_pattern = shift;
my $last_cmd;

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