rhiridflaidd Posted September 13, 2010 Posted September 13, 2010 I'm using an autoit frontend to launch some perl scripts. All well and good, unless a datapoint is wrong, and confuses my poor perl script and throws an error. run ('perl perlscript.pl dataile.txt',@ScriptDir,@SW_MAXIMIZE ) Is the command I'm running. How do I capture any error text, without catching the full stream of data that runs in the dos boxes as pretty little graphics to show progress. The scripts can take 10 mins plus. Ideally I'd like the dos box not to close until there is user input. But this can't be scripted in the perl, since the error will just call an end to the script.
wakillon Posted September 13, 2010 Posted September 13, 2010 Try thisi don't know if it work with perl #include <Constants.au3> $_Pid = Run (' perl perlscript.pl dataile.txt', '', @SW_MAXIMIZE, $STDERR_CHILD + $STDOUT_CHILD ) Dim $_StderrRead='', $_StdoutRead='' While ProcessExists ( $_Pid ) $_StderrRead = StderrRead ( $_Pid ) If Not @error And $_StderrRead <> '' Then ConsoleWrite ( "STDERR read : " & $_StderrRead & @Crlf ) EndIf $_StdoutRead = StdoutRead ( $_Pid ) If Not @error And $_StdoutRead <> '' Then ConsoleWrite ( "STDOUT read : " & $_StdoutRead & @Crlf ) EndIf Sleep ( 1 ) Wend AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now