Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: DNScmd in perl script

by almut (Canon)
on Jul 28, 2008 at 21:38 UTC ( [id://700668]=note: print w/replies, xml ) Need Help??


in reply to Re^2: DNScmd in perl script
in thread DNScmd in perl script

Presumably you have different environments. Try specifying the full path to the program. Also, in case $? is -1 (and only then), print $! to see the system error message.

Replies are listed 'Best First'.
Re^4: DNScmd in perl script
by ajd335 (Novice) on Jul 28, 2008 at 22:01 UTC
    Hi Almut, Yes , giving $! shows that No Such file or directory..What is causing that.....

      I personally believe that it has already been clearly explained to you: namely "No Such file or directory" means that there's no such file or directory. Where perl can possibly look for it, that is. That you can use the same command from your shell simply means that your shell knows where to look: just give perl the same info. You can either pass through the shell anyway, which I do not recommend (why spawn another process?) or give the full path to the program, which may be sensible in any case: what if someone puts an identically named program in some directory which comes first in your path? (Ok, this is an extremely minor detail...)

      --
      If you can't understand the incipit, then please check the IPB Campaign.
        Hi Blazar.. Yeah You are right.N that's what my q is.as we have "Exec" "Shell_exec" in PHP to run command from DOS and return results. The same , do we have something like that in perl also.So that I can run the command on DOS ( Which gives me correct answer) and than can store it. I will really appreciate.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://700668]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-19 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found