Why not have the subroutine write to STDERR.
Then just redirect STDERR to wherever you want the logged information to go. Either at the top of the main program or via the command line when you run it.
It's kinda what STDERR is for.
In reply to Re: "Global" filehandle without using global variables
by BrowserUk
in thread "Global" filehandle without using global variables
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |