in reply to J.A.D.N.A.
You could replace $0 with __FILE__ (<DATA> also comes to mind but I didn't digest the code enough to decide whether that would be usable here).