Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: write to cmd and save output

by AcidHawk (Vicar)
on Nov 19, 2003 at 12:48 UTC ( #308284=note: print w/replies, xml ) Need Help??

in reply to write to cmd and save output

Update:Doh.. I missed the interactively part..

If you mean run an executable and capture the output, there are several ways to do this.

$result = `mycmd.exe -param1 -param2`;

or you could look at win32::process but you would have to do some clever STDOUT redirection. Some links to follow..

  • Win32 Process Output
  • Re: Capturing error messages from Win32::Process
  • -----
    Of all the things I've lost in my life, its my mind I miss the most.

    Replies are listed 'Best First'.
    Re: Re: write to cmd and save output
    by aquarium (Curate) on Nov 19, 2003 at 13:24 UTC
      expect module is what you want
        except that it's not (it doesn't work on win32)
          you better tell activestate that it doesn't work. according to them it does. the module's doc url is

    Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (5)
    As of 2021-03-01 16:24 GMT
    Find Nodes?
      Voting Booth?
      My favorite kind of desktop background is:

      Results (13 votes). Check out past polls.