#!/bin/perl

if (@ARGV) {
	open (IN, "$ARGV[0]") || die "Cannot open input file!\n";
	while (<IN>) {
		if (index($_, "<") ne "-1") {
			$done = 0;
			$min = 0;
			$error = 0;
			$beginsplit = 0;
			$endsplit = 0;
			$grab = "";
			$count = 0;
			while ($done eq 0) {
				$beginsplit = index($_, "<", $min);
				$endsplit = index($_, ">", $min);
				if ($endsplit ne "-1") {
					$grab = substr($_, $beginsplit, $endsplit);
				   } else {
					$grab = substr($_, $beginsplit, 1000);
					}
				$min = $endsplit+1;
				if (($beginsplit eq "-1") | ($endsplit eq "-1")) {
					$done = 1;
				   } else {
					$count = tr/\"//;
					if (($count % 2) ne 0) {
						$done = 1;
						$error = 1;
						}
					}
				}
			if ($error ne 0) {
				print "The following line:\n";
				print "$_";
				print "Is probably in error.\n";
				}
			}
		}
	close(IN);
   } else {
	print "This script must have a valid file name as an arguement.\n";
	}

