in reply to DNScmd in perl script

Aside from the fact that the code you posted does not compile because the if/else is missing curlies, it seems as though the dnscmd command is failing. You should print the value of $? so that you can get more information as to the cause of the failure.

Replies are listed 'Best First'.
Re^2: DNScmd in perl script
by ajd335 (Novice) on Jul 28, 2008 at 21:18 UTC
    Hi Toolic , Yes I forgot to copy paste the curly brackets. The value of $? gives me -1 . I have tried out the same command with same argument on DOS , which gives me correct zones.
    if (not @zones) { if ($?) { print "Error "; } else { " zones done"; } }
    So was wondering why its like that..

      I personally believe, ajd335, that you made my day: we recommend all the time not to retype code to avoid such inconveniences, and appearently you have "selective" a copy-paste which will emulate the same error! Sorry for the humour, but please do not take it as personal attack and accept it as a good piece of advice to the effect of really using copy-paste.

      --
      If you can't understand the incipit, then please check the IPB Campaign.