Thanks a lot Arunbear this works nicely.
There's just one thing left for me:
I see that my AUTOLOAD method now also "catches" calls for DESTROY and I don't know exactly what's happening then. Isn't the AUTOLOAD method a litte too generic?
at the beginning of the AUTOLOAD sub, or define a do-nothing DESTROY method (assuming you really don't have any cleanup to do). Perl calls the DESTROY method when it does garbage collection, even if you haven't defined a DESTROY method.