> -----Original Message-----
> From: chad kellerman [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, February 01, 2003 6:38 PM
> To: [EMAIL PROTECTED]
> Subject: Use of uninitialized value in pattern match (m//) at 
> test.pl line 85.
> 
> 
> 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=>["/ro
> ot/.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<<<<

However, my opinion is that "temporarily turn off warnings"
is not a good programming practice.
You should may be make an other check on $out, before matching :

        if(!defined $out){
                #do
        }
        elsif($out =~/\/home2/){
                #do
        }
        else{
                #do
        }

But, this is just an idea.
Somebody has probably a best solution ...

HTH,

José.

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


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to