Index: /branches/eam_branches/ipp-20120601/psconfig/pscheckperl
===================================================================
--- /branches/eam_branches/ipp-20120601/psconfig/pscheckperl	(revision 34027)
+++ /branches/eam_branches/ipp-20120601/psconfig/pscheckperl	(revision 34028)
@@ -5,4 +5,5 @@
 $version = "";
 $build = 0;
+$clean = 0;
 my %force;   # Names of module to force build
 @tARGV = ();
@@ -14,4 +15,8 @@
     if ($ARGV[0] eq "-build") {
         $build = 1;
+        shift; next;
+    }
+    if ($ARGV[0] eq "-clean") {
+        $clean = 1;
         shift; next;
     }
@@ -32,4 +37,6 @@
 if ( @ARGV > 1) { &usage(); }
 
+if ($build && $clean) {die "-build and -clean are incompatible\n";}
+
 if ( @ARGV == 0) {
     @list = <$tagsets/*.perl>;
@@ -95,4 +102,14 @@
     # if ($modver eq "") { $modver = 0; }
 
+    if ($clean) {
+	($tardir) = $tarball =~ m|(\S*).tar.gz|;
+	$tardir = "../extperl/$tardir";
+	if (-d $tardir) {
+	    print "remove tardir: $tardir\n";
+	    vsystem ("rm -rf $tardir");
+	}
+	next;
+    }
+    
     system ("pscheckmods $module $modver");
     if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) {
