James.#!/usr/bin/perl use strict; use warnings; my $text; print "Prompt: "; alarm(10); eval { local $SIG{ALRM} = sub { die }; $text = <STDIN>; }; print "done accepting text\n";
In reply to Re: Time-limited input on STDIN
by jamesduncan
in thread Time-limited input on STDIN
by ajdelore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |