in reply to "Global" filehandle without using global variables
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.
|
|---|