Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Problem with system ()

by MarkM (Curate)
on Mar 19, 2003 at 02:55 UTC ( [id://244218]=note: print w/replies, xml ) Need Help??


in reply to Re: Problem with system ()
in thread Problem with system ()

A few corrections:

  1. 'system() and die()' is not very easy to parse. I strongly suggest "system()==0 or die" or even "if (system()!=0) { die }".
  2. system() does invoke cmd.exe on WINNT, just as it invokes command.com on WIN9x and /bin/sh on UNIX. There is no need to $ENV{'COMSPEC'}.
  3. You say "using shell commands to set the current directory is not guaranteed to influence the current working directory of the parent." In fact, chdir() system calls in a sub-process do not affect the current working directory of the parent at all on UNIX or WIN32. You really want to use chdir() directly, as "chdir($dir) or die".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found