snafu has asked for the wisdom of the Perl Monks concerning the following question:
I will take a stab at it. Select() simply select a filehandle to read and write to for the current process, right? But what exactly is the embedded select() doing??select( (select(STDERR), $|++)[0] );
It looks like the inside select() is returning element 0 of an array which the external select() is selecting.
So, I ran a couple of tests:
It looks like I now have select()'ed two filehandles to play with at the same time. Is that right? TIA, - Jim$ perl -e ' open(F,"/etc/passwd"); print select(F),"\n"; print select(STDOUT),"\n"; close(F); ' main::F $ perl -e ' open(F,"/etc/passwd"); print select((select(F),$|++)[0]),"\n"; print select(STDOUT),"\n";close(F); ' main::F main::STDOUT
_
_
_
_
_
_
_
_
_
_
- Jim
Insert clever comment here...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tear it apart...select()
by Aristotle (Chancellor) on Mar 02, 2003 at 00:57 UTC | |
|
•Re: Tear it apart...select()
by merlyn (Sage) on Mar 02, 2003 at 04:07 UTC | |
by Aristotle (Chancellor) on Mar 02, 2003 at 13:38 UTC | |
by merlyn (Sage) on Mar 02, 2003 at 15:02 UTC | |
by Aristotle (Chancellor) on Mar 02, 2003 at 15:47 UTC | |
by merlyn (Sage) on Mar 02, 2003 at 16:01 UTC | |
| |
by snafu (Chaplain) on Mar 02, 2003 at 05:50 UTC | |
|
Re: Tear it apart...select()
by Chmrr (Vicar) on Mar 01, 2003 at 22:08 UTC |