#!/usr/bin/perl -Tdw
#
# Kludge to split Mary Lou's RJ file into single-page files.

line:
for $line (<>) {
	if ($line =~ /^%\s*----+\s*set\s*(\d+)/) {
		close OUT;
		$out = 0;
		$file = sprintf("30th_%02d.abc",$1);
		unless (open(OUT,">$file")) {
			print STDERR "$0: Can't write \"$file\" [$!]\n";
			next line;
		}
		print "$file\n";
		$out = 1;
	}
	print OUT $line if $out;
}
