in reply to use 'select' to change default output handle for entire script

Is there any reason to believe select doesn't do all of that?

$ cat > script.pl print('!', $/); select(STDERR); sub test { print('@', $/); } test(); ^D $ perl script.pl 2>stderr ! $ cat stderr @ $

Are you worried that someone will select something else?

Replies are listed 'Best First'.
Re^2: use 'select' to change default output handle for entire script
by richz (Beadle) on Nov 23, 2004 at 19:03 UTC
    No, i had reason to believe select doesn't do that but it was my fault...I was launching the scripts from a Win32 app and CreateProcess() wasn't using the one in my PATH beucase of the search order blah blah.

    Bottom line, you're right and select does all of what I wanted.