Well, you have a code reference in your data structure and obviously XML::Simple cannot dump that. Simple, eh? ;-)
That is because perl does
not 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
eval it where appropriate.