Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Perl 5.8.4 bug? alarm + STDIN on Win32 == not working

Expand Messages
  • perlmedian
    ... Win32 does have alarm() in Perl 5.8 (or some strange emulation of it). What I am trying to find out is if it s a bug that alarm doesn t keep counting when
    Message 1 of 5 , May 4, 2004
    • 0 Attachment
      --- In perl-beginner@yahoogroups.com, Dave Gray <yahoogroups@d...> wrote:
      > Win32 doesn't support the alarm signal...
      >
      > And also if you run:
      > perl -e "print qq^$_\n^ for keys %SIG"
      >
      > on Win32 ALRM isn't there. I'm not 100% sure what the significance of
      > that is, but it *is* there on my linux box even without me defining one.

      Win32 does have alarm() in Perl 5.8 (or some strange emulation of it).
      What I am trying to find out is if it's a bug that alarm doesn't keep
      counting when waiting for STDIN. I don't know what the support
      is/going to be for alarm() on win32.

      You will see that alarm does work in the following code on Windows:

      $SIG{ALRM} = sub { die "Alarm!\n" };

      alarm 2;

      ## some really big loop that should take more than 2 seconds
      for ( 1 .. 2000000 ){
      for ( 1 .. 2000000 ){
      }
      }

      print "No alarm.\n";

      (see the parent post for the code that doesn't work)

      So I am wondering if it's something that needs fixing in CORE perl 5.8
      or if it's something that windows borks on its own.

      I see that others have reported bugs to this same problem, I added my
      info to one of those bugs:
      http://guest:guest@.../rt3/Ticket/Display.html?id=24892
    Your message has been successfully submitted and would be delivered to recipients shortly.