SelectSaver - save and restore selected file handle
use SelectSaver;{ my $saver = SelectSaver->new(FILEHANDLE); # FILEHANDLE is selected}# previous handle is selected{ my $saver = SelectSaver->new; # new handle may be selected, or not}# previous handle is selected
ASelectSaver
object contains a reference to the file handle that was selected when it was created. If itsnew
method gets an extra parameter, then that parameter is selected; otherwise, the selected file handle remains unchanged.
When aSelectSaver
is destroyed, it re-selects the file handle that was selected when it was created.
Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.
The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.