Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-17 Thread drieux
On Sunday, Nov 16, 2003, at 21:22 US/Pacific, R. Joseph Newton wrote: drieux wrote: I on the other hand have had the unpleasantry of FORGETTING that I was whacking new code in that was doing a 'select'. So one solution is to make sure that IF you do a select that you put things back where you fou

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread R. Joseph Newton
"R. Joseph Newton" wrote: > ...or better yet, to redo your code a little, and write to and read > from explicitly-selected filehandles. Duh. That should have been "explicitly-speciifed". Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 16, R. Joseph Newton said: >sometimes. The perfect setup for the great Perl anonymous block: > >{ >$| = 1; > do stuff that really needs to be autoflushed >} # Get things back to normal I think you want a 'local' in front of that $| line. { local $| = 1; # ... }

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread R. Joseph Newton
drieux wrote: > yes, in the sense that it comes in the section about > > select RBITS,WBITS,EBITS,TIMEOUT > > and as long as the person stays safely with the 'simpler' > perl select, and does not wander off into having buffered > and unbuffered file handles, then clearly it is "out of co

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread R. Joseph Newton
drieux wrote: > I on the other hand have had the unpleasantry of FORGETTING > that I was whacking new code in that was doing a 'select'. > > So one solution is to make sure that IF you do a select that > you put things back where you found them, eg: > > my $oldfh = select($newfh); >

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 16, Hacksaw said: >The fact that select has two incompatible meanings in perl is a >mistake. If I were going to rename them, I'd call the default output >changing command defout or default_output. As for the C lib function, >I'd call it readydesc or ready_descriptors. I think 'select' is a

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Hacksaw
>So my intention was to finish off the general discussion >of 'do you really need select' with that simple reminder >that when one does need select, one also needs to do some >basic defensive coding one place or the other. This post goes a ways to showing why unthinking operator overloading is a

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread drieux
On Sunday, Nov 16, 2003, at 10:41 US/Pacific, Jeff 'japhy' Pinyan wrote: [..] And yes, DO remember the caveat at the end of the select perldoc that notes: WARNING: One should not attempt to mix buffered I/O (like "read" or ) with "select", except as permitted

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-16 Thread Jeff 'japhy' Pinyan
On Nov 16, drieux said: > select FILEHANDLE > select Returns the currently selected filehandle. Sets the > current default filehandle for output, if FILEHANDLE > is supplied. This has two effects: first, a "write" > or a "print" without a filehan