in reply to Strange piece of code!

It selects ERRFP, sets that handle's autoflush mode to on, and then reselects the original filehandle.

What it's missing is a # Comment.


Dave

Replies are listed 'Best First'.
Re^2: Strange piece of code!
by solegaonkar (Beadle) on Jul 26, 2012 at 10:04 UTC
    Dave, Thanks for that. But that is what confuses me.. is there any value added by selecting ERRPF again?

      It's not selecting ERRPF again, it's reselecting the original filehandle... whatever was current before the first select (before ERRPF). select returns the filehandle that was current before the call.

      Read it from the inside out:

      1. select ERRPF and remember whatever was selected beforehand.
      2. Set autoflush on ERRPF
      3. Return to the outer select the first element in the list, which is the filehandle that we remembered in step one
      4. select that "remembered" filehandle.

      Dave

        O! I get it now. Thank you Sir!