Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: how to use angle operator with timeout?

by BrowserUk (Pope)
on Feb 03, 2013 at 23:55 UTC ( #1016878=note: print w/ replies, xml ) Need Help??


in reply to Re: how to use angle operator with timeout?
in thread how to use angle operator with timeout?

Does that work on *nix? Cos it never times out on Windows.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^2: how to use angle operator with timeout?
Re^3: how to use angle operator with timeout?
by Anonymous Monk on Feb 04, 2013 at 00:50 UTC

      I know that they do not work on win32, and why.

      My question was: can signals -- alarm generated or otherwise -- interrupt blocking IO on *nix in under the auspices of safe-signals?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        This works on *nix:

        use strict ; use warnings ; my $timeout_in = 5 ; eval { local $SIG{ALRM} = sub { die "timed_out\n" }; alarm($timeout_in); while(<>) { alarm($timeout_in); my $in = $_ ; chomp( $in ) ; print $in . "\n" ; last if( $in eq 'exit' ); } alarm(0) ; }; if ($@) { die( "Hey ... whats with the slow typing ??\n" ); }
Re^3: how to use angle operator with timeout?
by tobyink (Abbot) on Feb 04, 2013 at 15:07 UTC

    "Does that work on *nix? Cos it never times out on Windows."

    Works for me (on Linux).

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2014-10-26 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (152 votes), past polls