#!/usr/bin/perl #use strict; use warnings; # Checking details of the host. Domainname and the OS version will be checked. my $SSH = '/usr/bin/ssh -o StrictHostKeyChecking=no' ; my $DOMAIN = '/bin/domainname'; my $LINUXOS = 'cat /etc/redhat-release'; my $UNIXOS = '/bin/uname -sr'; print "Enter the filename: "; chomp($HOSTLIST = ); open HOSTS, $HOSTLIST or die "can't open the file: $!\n" ; foreach my $host () { chop($host); # if i do not use chop, ? comes in the ssh command. @details = qx($SSH $host $DOMAIN; $LINUXOS); print @details; }