This script demonstrates using KiokuDB to properly serialize a closure, including maintaining the proper identity of all the referenced objects in the captured variables.
This feature is used to implement a simple job queue, where the queue management is handled by DBIC, but the job body is a closure.
Actual job queue features are missing (e.g. marking a job as in progress, etc), but the point is to show off KiokuDB, not to write a job queue ;-)
To install KiokuDB::Backend::DBI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm KiokuDB::Backend::DBI
CPAN shell
perl -MCPAN -e shell install KiokuDB::Backend::DBI
For more information on module installation, please visit the detailed CPAN module installation guide.