Return values can be useful

(217 strokes) maybe_print_m will always return 1; we can use that to initialize things, and invert some if statements at the same time.
#!perl -nl
sub maybe_print_m {
	$DONE_M || print "$PREFIX.M";
}
$PRINTED_LINE = 1;
/$PREFIX/ or$DONE_M=!maybe_print_m;
/\./;
$PREFIX=$`;
$DONE_M=/M$/ || maybe_print_m if /[M-Z]$/;
print;
END {
	$PRINTED_LINE&&maybe_print_m
}