Hi guys,

   How can I get around this "warning"

Use of uninitialized value in pattern match (m//) at test.pl line 85.

For some reason I always get driveNum=2.

I am using warinig and strict in my code..

<code>

if ($pong->ping($mslRef{$server}{ip})) {
        
        #check for 2 drives    
        my $cmd = "grep /home2 /etc/fstab|awk \'{print \$2}\'";

        my ($out, $err, $exit);
        eval {
             my $ssh =
Net::SSH::Perl->new($mslRef{$server}{ip},identity_files=>["/root/.ssh/identity"]);
                $ssh->login("$user");
             ($out, $err, $exit) = $ssh->cmd($cmd); 
        };
        if ($@) {        
            LogIt("Error from eval in Net::SSH::Perl\->
$@:$mslRef{$server}{hostname}:$mslRef{$server}{ip}");
        }elsif ($err) {
            LogIt("Error in command sent thru Net::SSH::Perl\->
$err:$mslRef{$server}{hostname}:$mslRef{$server}{ip}");
        }
>>>>Line 86 below<<<<
        if (defined $out =~ /\/home2/ ) {
            my $driveNum = "2";
            #MysqlIt($server,$driveNum,%mslRef);
            TestIt($server,$driveNum,%mslRef);
        }else{
            my $driveNum = "1";
            #MysqlIt($server,$driveNum,%mslRef);
            TestIt($server,$driveNum,%mslRef);
        }

</code>

If /home2 is not returned from the ssh commnd I get the warning

thanks in advance for the help.

chad
-- 
chad kellerman <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to