in reply to Re: exec()ed process dont write to std(?:err|out) (system)
in thread exec()ed process dont write to std(?:err|out)

Ok, and just to make this clear, Win32 simulates fork, and is thus in the category where it doesnt have a fork right?

If I do use system am I going to be wasting a lot of resources by having an outer normal perl running a system() call to another perl invocation? Also in your opinion is this a bad idea?


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi


Replies are listed 'Best First'.
Re^3: exec()ed process dont write to std(?:err|out) (system)
by tye (Sage) on Apr 13, 2004 at 15:30 UTC

    Yes, Win32 doesn't have fork.

    Since most uses of system() (which are done outside of Perl, I'd guess) end up calling /bin/sh just to interpret the command-line syntax and then have /bin/sh just sitting around the entire time waiting for the program you really wanted to run to exit, I don't think it can be too awful to have a similar situation with perl sitting around.

    As for the bigger picture of what you are really trying to do, I won't pretend to understand it.

    - tye        

      As for the bigger picture of what you are really trying to do, I won't pretend to understand it.

      Oh sorry. The idea is so that when I have a bunch of scripts running I can see which perl is running which script in the process view of the task manager. For instance I may have 5 or 6 different scripts running at various points at the day. When I view the task manager I can only see say three "perl.exe"'s running, with no easy way to know _what_ they are running. So if one of them goes nuts I know which task to kill for example.


      ---
      demerphq

        First they ignore you, then they laugh at you, then they fight you, then you win.
        -- Gandhi


        start "skimFundsFromTransactions.pl" perl -S skimFundsFromTransactions +.pl CreditCard 0.002% $100,000

        Go to "task manager", select the "Applications" tab, right-click on the application titled "skimFundsFromTransactions.pl", select "Go to process" from the resulting pop-up menu, note that a specific instance of perl.exe is now highlighted in the "Processes" tab.

        Alternately, if you write your little trick or something similar using a *.bat or *.cmd instead of Perl, then you don't need to have the intermediary instance of perl.exe (which will clutter your taskmanager display). You can even steal a trick I've used several times of having a *.bat that is mostly a Perl script but that writes the final command to be run afters its "__END__" and ":endofperl" lines, to get the same effect while not having to know as much about *.bat/*.cmd programming.

        - tye