Selenis B Leguisamon said:
>I am trying to write a perl program but I keep getting errors and I was 
>wondering if you can give me some pointers that might help. The program is 
>supposed to read from a file which has a list of server names then put 
>this names in an array. I then used a foreach loop that is supposed to 
>read each server name and execute this command: uname -r remsh $server. 
>This command is supposed to go to each server and then print out the 
>version of each server but this is the part of the program that I keep 
>getting errors on. This is the complete program that I have so far:
>
>#!/usr/local/bin/perl -w /*enable warnings*/
>
use strict; /*do this, seriously*/

>print "\n";
my $data_file="testserv.txt";
>open(DAT, $data_file) || die("Could not open file!");
while (<DAT>){
        chomp; /*dump those newlines! */
/* do you want a line like 
   s/\s*//g;
        to throw other whitespace garbage away here? */
>print "\n";
remsh $_ uname -r; /* I don't know hwat you are doing with remsh, first
                      I've hard of it, but I assume you've looked at the
                      appropriate docs. perldoc -f system prehaps?*/
}
close DAT;

>
>Please let me know what is the best way to go from server to server and 
>obtain the necessary information in a perl program.
>Thanks a lot !!!!!
All the best with it.
- 
Kind regards,
Hal Ashburner

-- 
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