Can you critique my script, please?

#!/usr/bin/perl -w
use strict;

#Automates pinging and checking a blade for the
#nrnode.
#Usage: checkDemon
#Created by Chris Spears 9/7/05 version 1.

while (1) {
   print "Enter a blade number: ";
   chomp(my $bladeNumber = <STDIN>);
   my $blade = "blade-".$bladeNumber;

   while (1) {
      print "What would you like to do?\n";
      print "1) ping $blade\n";
      print "2) ssh $blade\n";
      print "3) Quit program\n";
      print "4) Check a new blade\n";
      chomp(my $choice = <STDIN>);
      
      if ($choice =~ /1/) {
         system("ping $blade");
      } elsif ($choice =~ /2/) {
         system("ssh $blade ps -aux | grep nrnode");
      } elsif ($choice =~ /3/) {
         print "Quitting\n";
         exit;
      } elsif ($choice =~ /4/) {
         last;
      } else {
         print "Not an option.\n";
      }
   }
}



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to