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

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

Expand Messages
  • Dave Gray
    ... Oh. I see what you re trying to do. My bad. That s not really a beginner question :) There are some useful hints here:
    Message 1 of 5 , May 4, 2004
    • 0 Attachment
      > Now, I would like some useful comments as to why the same code works
      > differently on each OS.

      Oh. I see what you're trying to do. My bad. That's not really a beginner
      question :)

      There are some useful hints here:
      <http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&c2coff=1&q=win32+%27%24SIG%7BALRM%7D%27&btnG=Search>
      Most of the links either directly say or make reference to the fact that
      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.
    • 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 2 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.