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.
If your own program is OO, and store filename as a property of your class, you can access it without pass it as a parameter, the real parameter you need to pass is the class (a blessed hash ref or whatever).
Then you will not care the many calls in between any more.