On 8/15/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> "Chas Owens" schreef:
>
> > A one second sleep is common, but you can sleep for less than a second
> > with usleep from the Time::HiRes* module if this is too slow for your
> > purposes.
>
> AFAIK, a "sleep 1" could take anything between 0 and 2 seco
"Chas Owens" schreef:
> A one second sleep is common, but you can sleep for less than a second
> with usleep from the Time::HiRes* module if this is too slow for your
> purposes.
AFAIK, a "sleep 1" could take anything between 0 and 2 seconds. See also
select().
--
Affijn, Ruud
"Gewoon is een t
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>but you can sleep for less than a second
>with usleep from the Time::HiRes* module if this is too slow for your
>purposes.
>
Or use four arguments version of select,see perldoc -f select.
--
Jeff Pang <[EMAIL PROTECTED]>
http://h
On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
snip
> Its not really making sense to me why you are adding sleep to this.
> Cant I do this as fast as possible?
snip
I added sleep for two reasons, to show that it worked and to prevent
it from hogging the CPU. With non-blocking IO you pro
On Aug 13, 10:47 pm, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 8/13/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
>
>
>
> > -Original Message-
> > >From: [EMAIL PROTECTED]
> > >Sent: Aug 14, 2007 3:20 AM
> > >To: [EMAIL PROTECTED]
> >
On 8/13/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
>
>
> -Original Message-
> >From: [EMAIL PROTECTED]
> >Sent: Aug 14, 2007 3:20 AM
> >To: beginners@perl.org
> >Subject: piping and reading stdin
> >
> >I want to read from a pipe
-Original Message-
>From: [EMAIL PROTECTED]
>Sent: Aug 14, 2007 3:20 AM
>To: beginners@perl.org
>Subject: piping and reading stdin
>
>I want to read from a pipe in my perl script invoked like:
>
>date | perl myperlscript.pl
>
>I understand that this puts th
I want to read from a pipe in my perl script invoked like:
date | perl myperlscript.pl
I understand that this puts the text outputted from the date program
into the stdin. How could I check the buffer contained by the stdin
without it blocking for you to input anything from the keyboard if
nothin