AAB has asked for the wisdom of the Perl Monks concerning the following question:
use File::Temp qw/ tempfile /; my ( $fh, $filename ) = tempfile(); my ( $eh, $errorname ) = tempfile(); use Win32::Job; my $job = Win32::Job->new; my $exe = "remotely_executing_program_tool.exe"; my $args = " some_command_line_that_connects_and_runs_stuff_on_remote_machine"; my %opts = ( 'stdout' => $fh, 'stderr' => $eh ); #print $args; $job->spawn( $exe, $args, \%opts ); $job->run(120); $job->kill(); local $/ = undef; open F, '<', $filename; $text = <F>; close F; $connectOk = 0 if length($text) < 1; open F, '<', $errorname; $errStr = <F>; close F; $retval = $text; #print $retval;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval horrors
by tchrist (Pilgrim) on May 12, 2011 at 18:17 UTC | |
|
Re: eval horrors
by Anonymous Monk on May 12, 2011 at 17:40 UTC |