J Krugman said:
OK, how do you do it through if you have the typeglob, not just a
reference to it?
Sorry, I seem to have confused you... the intention was that you cannot
assign to the filehandle slot at all, whether through a typeglob ref or
not.
I'm trying to find a way to temporarily reassign DB::OUT in perldb.
Everything I've tried has failed...
The reason I want to reassign DB::OUT is that I want to capture
the output of certain perldb commands (e.g. x or V) to a file.
open my $SAVE_DBOUT, '>&=', DB::OUT;
open DB::OUT, '>', 'file';
....
open DB::OUT, '>&=', $SAVE_DBOUT;
If you're not using 5.8 you'll need to change those to
open my $SAVE_DBOUT, '>&=' . fileno DB::OUT;
..
This a common expression here... it means 'you asked how to do X, but
you're actually trying to do Y and X is not the way to go about it'. The
implication is that we'll be better able to help you if you tell us what
Y is.
Ben