Data::Dumper is incapable of properly dumping closures. You can use it (at least later versions) as an alternate interface to B::Deparse which can dump code, but unfortunately Deparse is only able to tell half the story, that is the source code involved in the subroutine, it is not able to provide the context required to properly recreate a closure. DD should be able to provide the context, but for many reasons it does not.
Enter Data::Dump::Streamer. DDS is specifically designed to be capable of dumping closures properly. diotalevi and I spent a fair amount of time making the closure dumping code work properly and IMO we have done a pretty reasonable job. In some situations you may find that DDS needs to rename some of the variables you used in your code, but under normal circumstances this isnt required.
If you have any trouble with using DDS for this please let me know.
Update: Fixed diotalevis name. :-)
In reply to Re: Dispatch Table and Data::Dumper (use Data::Dump::Streamer instead)
in thread Dispatch Table and Data::Dumper by ghenry
<code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>