in reply to Recursively changing STDOUT

You can use lexical variables as file handles:

open (my $saveout, ...);

Replies are listed 'Best First'.
Re^2: Recursively changing STDOUT
by casiano (Pilgrim) on Sep 16, 2007 at 12:32 UTC
    Thanks Moritz,

    But to recover the old values I have now:

    open(STDOUT, ">&SAVEOUT"); open(STDERR, ">&SAVEERR");

    ¿Can I use this with lexical variables? i.e.

    open(STDOUT, ">&$SAVEOUT"); open(STDERR, ">&$SAVEERR");

    It will not produce a interpolation of the filehandle?

    Casiano