#!/usr/bin/perl -w
#
#NAME
#  minicribsplit - Chop up minicrib file into single-dance files
#
#SYNOPSIS
#  minicribsplit [file]..
#
#DESCRIPTION
#
#OPTIONS
#
#EXAMPLES
#
#FILES
#
#BUGS
#
#SEE ALSO
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu>

$| = 1;
($P = $0) =~ s".*/"";
$V = $ENV{"V_$P"} || 1;
$indance = 0;	# True when we're inside a dance description.

for $line (<>) {
	$line =~ s/[\s\r\n]+$//;
	if ($line == '--') {
		close DANCE;
		$indance = 0;
	}
	$title = $rhythm = $form = $author = $book = '';
	if (
		(($title,$rhythm,$form,$author,$book) = ($line =~ m"([-/\w\s]+)  +\(([^)]+)\)  +(.*)  +(.*)  +(.*)$"))
	||	(($title,$rhythm,$form,$author      ) = ($line =~ m"([-/\w\s]+)  +\(([^)]+)\)  +(.*)  +(.*)$"))
	||	(($title,$rhythm,$form              ) = ($line =~ m"([-/\w\s]+)  +\(([^)]+)\)  +(.*)$"))
	) {
	}
}
