Hello Monks - Being a Newbie in perl, i am stuck in an if() situation in my code, which happens to check server health. Problem is, I am comparing 2 variables in if(), based on that perl will run commands locally or Remote, please the code snippet below :
I used arrows in below code to indicate whats what. Please help.sub cpuchk() { my $SRVCHX = shift; message("Server Received is : $SRVCHX"); ----> Testing to chec +k Server name passed from outside(good) message("host test : $HOSTNME"); ----> testing to check curre +nt hostname(good) if($SRVCHX eq $HOSTNME ) ------>Problem here - when both t +he values are same, it still does not execute if and goes to else { message("Local Server Selected, Executing commands loc +ally.."); localcpucmds(); } else { message("Remote server selected: $SRVC +HX"); . . Executes commands on remote server...
In reply to Perl IF Issue by intoperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |