The actual program is much more complex than the prototype I've included here. The filename is required many sub calls away.
I know about the risks of using private elements directly and am willing to run the risk at this point. The only other "clean" option left to me would be to make the filename global and I'd rather avoid that if possible.