avoid warnings when there's no subs to autosplit
Gurusamy Sarathy [Mon, 24 Jan 2000 09:40:24 +0000 (09:40 +0000)]
p4raw-id: //depot/perl@4873

lib/AutoSplit.pm

index 3cb01a1..936edc4 100644 (file)
@@ -352,8 +352,10 @@ EOT
        }
        $last_package = $this_package if defined $this_package;
     }
-    print OUT @cache,"1;\n# end of $last_package\::$subname\n";
-    close(OUT);
+    if ($subname) {
+       print OUT @cache,"1;\n# end of $last_package\::$subname\n";
+       close(OUT);
+    }
     close(IN);
     
     if (!$keep){  # don't keep any obsolete *.al files in the directory