select( ( select(STDOUT), $| = 1 )[0] );
This only works if the inner select is evaluated before the assignment is, and I can't find any specification of evaluation order (remember ++$a, $a++, ++$a?)
That's why I don't dare to use this idiom, although I see it often. I still prefer STDOUT->autoflush(1) (using IO::Handle). It's shorter too :)
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
In reply to Re: Re: Cheap idioms
by Juerd
in thread Cheap idioms
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |