YA resync with mainstem, including VMS patches from others
[p5sagit/p5-mst-13.2.git] / eg / scan / scanner
index 25e953d..e73cdc8 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Header: scanner,v 2.0 88/06/05 00:17:42 root Exp $
+# $RCSfile: scanner,v $$Revision: 4.1 $$Date: 92/08/07 17:20:44 $
 
 # This runs all the scan_* routines on all the machines in /etc/ghosts.
 # We run this every morning at about 6 am:
@@ -20,7 +20,7 @@ $| = 1;               # command buffering on stdout
 
 print "Subject: bizarre happenings\n\n";
 
-(chdir '/usr/adm/private') || die "Can't cd.";
+(chdir '/usr/adm/private') || die "Can't cd to /usr/adm/private: $!\n";
 
 if ($#ARGV >= 0) {
     @scanlist = @ARGV;
@@ -60,7 +60,7 @@ scan: while ($scan = shift(@scanlist)) {
                $iter = 0;
                `exec crypt -inquire <$scan >.x 2>/dev/null`;
                unless (open(scan,'.x')) {
-                   print "Can't run $scan.";
+                   print "Can't run $scan: $!\n";
                    next scan;
                }
                $cmd = <scan>;
@@ -68,17 +68,17 @@ scan: while ($scan = shift(@scanlist)) {
                    $cmd = '/usr/bin/perl';
                }
                close(scan);
-               if (open(pipe,"exec rsh $host '$cmd' <.x|")) {
+               if (open(PIPE,"exec rsh $host '$cmd' <.x|")) {
                    sleep(5);
                    unlink '.x';
-                   while (<pipe>) {
+                   while (<PIPE>) {
                        last if $iter++ > 1000;         # must be looping
                        next if /^[0-9.]+u [0-9.]+s/;
                        print $showhost,$_;
                    }
-                   close(pipe);
+                   close(PIPE);
                } else {
-                   print "(Can't execute rsh.)\n";
+                   print "(Can't execute rsh: $!)\n";
                }
                last class;
            }