RE: perl won't alarm?

2011-02-23 Thread Jan Dubois
On Wed, 23 Feb 2011, Robert W Weaver wrote:
> Is there a way I can protect my routine from hanging system calls?

alarm() will not interrupt a blocking system call on Windows.
If you want to timeout on subprocesses, then you may want to
look at Win32::Job.

Cheers,
-Jan

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


perl won't alarm?

2011-02-23 Thread Robert W Weaver

I have code that executes an external command, vis:

  eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm $TIMEOUT;
$text = `$pre_command$host $post_command` || ( $connectOk = 0 );
alarm 0;
$errStr = $^E;
  };

The command hangs for a reason I don't understand (its a PsExec of opmnctl
@cluster status -app on a windows oracle server).  Unfortunately, the block
above never exits.

Is there a way I can protect my routine from hanging system calls?


--
   
 Dr. Robert "Woody" Security, Privacy, Wireless, and   
 Weaver Information Assurance  
   
 IT Security Architect  Cell: 301-524-8138 
   


--
I have great faith in fools -- self confidence my friends call it.
-- Edgar Allan Poe

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs