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