in reply to Re: Wanting Validation for Smacking my Sysadmin (500 error problem)
in thread Wanting Validation for Smacking my Sysadmin (500 error problem)

The snippet unbuffers the I/O to STDOUT, by setting $| to true. Running it, I just noticed that you can't do local STDOUT;, as STDOUT is not a variable, but a constant referring to file descriptor 1. The snippet works without that part.

What it does, working inside out, is:

$|++;
set currently selected file descriptor to unbuffered I/O
select(STDOUT);
make STDOUT currently selected file descriptor. This returns the previously selected FD.
select ( ( select(STDOUT),$++)[0]);
Select the first value in the list (select(STDOUT),$|++), which is the return value of select(STDOUT), which is the previously selected file descriptor.

The snippet basically sets STDOUT to unbuffered I/O whilst preserving the previously selected filehandle as selected. Have a look in perlfaq for a better explanation.

CU
Robartes-