Ok, that makes a lot more sense.  Thanks for the clarification.

-----Original Message-----
From: Rob Dixon [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 5:21 AM
To: Timothy Johnson; [EMAIL PROTECTED]
Subject: Re: Joining with a basic question


Timothy

select() returns the original output filehandle that was in force before the
new one is selected. That means that

    ( select( STDOUT ), $| = 1 )

is the same as

    ( oldfilehandle, 1 )

so

    select ( ( select( STDOUT ), $| = 1 )[0] )

is the same as

    select ( oldfilehandle )

i.e. STDOUT is selected to enable autoflush and then the originally active
filehandle is reselected.

For the sake of clarity, how about:

    use IO::Handle;

        .
        .

    autoflush STDOUT;

Cheers all,

Rob




----- Original Message -----
From: "Timothy Johnson" <[EMAIL PROTECTED]>
To: "'Weijie Ding'" <[EMAIL PROTECTED]>; "Andrew F."
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, December 03, 2002 10:00 AM
Subject: RE: Joining with a basic question


>
> Wow, and I thought mine was cryptic.  Maybe you can explain exactly what
> you're doing here.  I know that by setting $| to 1 you are setting the
> selected filehandle (STDOUT by default) to AutoFlush instead of buffering
> it, but I don't get the rest.  It looks like you're saying this:
>
>      select() the first element of the list (select(STDOUT), $| = 1)
>
> which should be the equivalent of "select(select(STDOUT))".  I'm assuming
> that select(STDOUT) returns the filehandle that was selected if
successful,
> because that would make it the equivalent of
>
>      select(STDOUT)
>
> but then you have the $| = 1 in there, which will set the autoflush to on
> for STDOUT if executed any time after select()ing STDOUT and before
select()
> ing another filehandle.  I just don't understand how it all fits together
as
> presented, and maybe that's where you can help me.  How is this different
> from:
>
>      select(STDOUT);
>      $| = 1;
>
>
>
>
> -----Original Message-----
> From: Weijie Ding [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 02, 2002 9:52 PM
> To: Andrew F.; [EMAIL PROTECTED]
> Subject: Re: Joining with a basic question
>
>
> Hi, Andrew F.,
> 2002-12-03 13:48:40
>
> I think this may because your buffered output.
> You can use the following to set output unbuffered/flushed before your
first
> statement in your program.
>
> select((select(STDOUT), $| = 1)[0]);
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to