more useful options | |
PerlMonks |
Re^3: select($rin,undef,undef,undef) only blocking onceby Tanalis (Curate) |
on Jul 26, 2005 at 12:09 UTC ( [id://478151]=note: print w/replies, xml ) | Need Help?? |
It'd seem to be.
I still favour a blocking read over blocking using select, though - you're using two system calls (which are relatively expensive) to do the job of one (unless there's something I'm missing). Paraphrasing the Cookbook a little, replacing your loop with would seem to work as expected. Just as a final point, I'm not 100% sure what you're trying to achieve with your calls to index and substr - all you seem to be doing there is stripping the newline, which you can achieve using chomp. Hope that helps. -- Foxcub
In Section
Seekers of Perl Wisdom
|
|