Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Processing command line arguments

by El Linko (Beadle)
on May 19, 2004 at 08:34 UTC ( [id://354555]=note: print w/replies, xml ) Need Help??


in reply to Processing command line arguments

2 - Another option is select ( perldoc -f select ).

The code below will give you 5 seconds to enter text on STDIN.
A higher level interface seems to be provided by IO::Select.
use strict; use warnings; my $seconds = 5; my $rin = ""; vec( $rin , fileno( STDIN ) , 1 ) = 1; my ( $found , $left ) = select( $rin , undef , undef , $seconds ); if( $left ) { print "you said " . <STDIN> . "\n"; } else { print "nothing to see\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found