Well, you have a code reference in your data structure and obviously XML::Simple cannot dump that. Simple, eh? ;-)
store the coderef in source (as text) but in compiled form somewhere in memory. So it can never be dumped. Maybe you want to store the code as text in your structure and
it where appropriate.