hi, u can do : $var|=10; # like that if u want to set the variable to a default value-- # if the $var is not defined it assigns a value of 10 to it. KM
------------------------------------------ On Sat, 1 Feb 2003, Rob Dixon wrote: > Chad Kellerman wrote: > > 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.. > > > [snip code] > > > > >>>>Line 86 below<<<< > > I presume you mean line 85? > > > if (defined $out =~ /\/home2/ ) { > > I'm not sure what you mean here. It's wrong anyway! This > expression means: > > defined ($out =~ m[/home2]); > > which is the same as: > > defined (1) # if the match succeeds > or > defined (0) # if it doesn't > > Either way, both 1 and 0 are defined and the > entire expression is true. Perhaps what you > wanted was: > > if ( defined $out and $out =~ m[/home] ) > > > my $driveNum = "2"; > > #MysqlIt($server,$driveNum,%mslRef); > > TestIt($server,$driveNum,%mslRef); > > }else{ > > my $driveNum = "1"; > > #MysqlIt($server,$driveNum,%mslRef); > > TestIt($server,$driveNum,%mslRef); > > } > > > > If /home2 is not returned from the ssh commnd I get the warning > > HTH, > > Rob > > > > > > -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]