print and write without specific file handles output on currently selected filehandle. |
select(FILEHANDLE_NEW) sets new filehandle FILEHANDLE_NEW and returns old (current) filehandle. |
$oldhandle = select(NEWHANDLE); |
$~ = "Newformat"; or $FORMAT_NAME instead of $~ if use English |
select($oldhandle); # ingeniously sets "Newformat" to be format associated with NEWHANDLE |
One can have lots of FILEHANDLES and lots of formats but each FILEHANDLE is only associated with one format at a time. |