Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: write to cmd and save output

by AcidHawk (Vicar)
on Nov 19, 2003 at 12:48 UTC ( [id://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 http://aspn.activestate.com/ASPN/CodeDoc/Expect/Expect.html

    Log In?
    Username:
    Password:

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

    How do I use this?Last hourOther CB clients
    Other Users?
    Others chilling in the Monastery: (5)
    As of 2024-03-29 08:26 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found