Reference: new (Perl in a Nutshell)

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 8.128 SelectSaverChapter 8
Standard Modules
Next: 8.128 SelectSaver
 

new

$saver = new SelectSaver[(fh)]

Constructor. Creates a new SelectSaver object, $saver, which saves the current filehandle. The optional parameter fh is the filehandle that is to temporarily replace the current filehandle. If fh is present, the current filehandle is saved in $saver and the new one becomes the current filehandle. With no parameter, the current filehandle is saved in the object $saver, and it also remains current.

You can use the newly selected filehandle within the current block. When you exit the block, the previous filehandle is again made the current one, and the SelectSaver object in which it was stored is destroyed.


Previous: 8.128 SelectSaverPerl in a NutshellNext: 8.128 SelectSaver
8.128 SelectSaverBook Index8.128 SelectSaver

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.