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 }