1SelectSaver(3pm) Perl Programmers Reference Guide SelectSaver(3pm)
2
3
4
6 SelectSaver - save and restore selected file handle
7
9 use SelectSaver;
10
11 {
12 my $saver = new SelectSaver(FILEHANDLE);
13 # FILEHANDLE is selected
14 }
15 # previous handle is selected
16
17 {
18 my $saver = new SelectSaver;
19 # new handle may be selected, or not
20 }
21 # previous handle is selected
22
24 A "SelectSaver" object contains a reference to the file handle that was
25 selected when it was created. If its "new" method gets an extra param‐
26 eter, then that parameter is selected; otherwise, the selected file
27 handle remains unchanged.
28
29 When a "SelectSaver" is destroyed, it re-selects the file handle that
30 was selected when it was created.
31
32
33
34perl v5.8.8 2001-09-21 SelectSaver(3pm)