Hi,
On Fri, Feb 4, 2011 at 9:23 PM, C.DeRykus <[email protected]> wrote:
>
> Not particularly elegant since output is sent to a file
> via backticks but I succeeded in getting test program
> output that occurs prior to a 3 second timeout, eg:
>
> use strict;
> use warnings;
> use Win32::Job;
>
> my $job = Win32::Job->new;
> my $timeout = 3;
>
> $job->spawn( $ENV{PERL},
> 'perl.exe -e "system q{c:/temp/test.pl>out.tmp 2>&1}"'
> );
> $job->run($timeout);
> __END__
>
> -----------------------------------------
> test.pl:
> #!perl
> print "line1\n";
> sleep 1;
> warn "line1 to stderr\n";
> sleep 5;
> print "lastline\n";
>
> -----------------------------------------
> The output file contains:
> line1
> line1 to stderr
>
It works with your test program, but I cannot get it to work with the
iscsicli.exe command, unfortunately...
Best regards,
Filip
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/