#!/usr/bin/perl
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# This little routine builds a table of all the ClearCase elements  that  the #
# user  has  checked  out.  It adds all the names to %checkedout.  The return #
# value is the table of checked-out elements (or the count*2, if called in  a #
# scalar context).                                                            #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
sub checkedout {
	local($p);
	%checkedout = ();	# Empty out the global list.
	open(P,"cleartool lsc -avobs -me |")
		|| die "Can't run \"cleartool lsc -avobs -me\"\n";
	for $p (<P>) {
		if ($p =~ /version\s+"(.*)"\s+from\s+(.*)\s*/) {
			$checkedout{$1} = $2;
		}
	}
	return %checkedout;
}
1;
