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

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        

  • Comment on Re^3: exec()ed process dont write to std(?:err|out) (system)

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

    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        

        You can even steal a trick I've used several times

        Heh, believe me I thought of it already. And yes I thought of it as "tye's trick", from one of the registry tools you posted. :-) The problem with it was that I couldn't (and still can't) see how I can use a single wrapper with multiple scripts this way. I was worried about multiple scripts modifying the batch file simultaneously. And if I wrap all the scripts in the first place then I might as well just modify pl2bat to do the right thing in the first place.

        But using start with a specific name hadnt occured to me. Good idea. Thanks.


        ---
        demerphq

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