in reply to Distributing binary data along with a CPAN module
For binary/precomputed test data, just chuck it in t/data.
For binary/precomputed run-time module data, you can use the matched pair of Module::Install install_share to install the files with your module, and locate them post-install with File::ShareDir.
See CPAN for more details.
Re^2: Distributing binary data along with a CPAN module
by DrHyde (Prior) on Feb 25, 2008 at 11:03 UTC
|
Or if you don't like Module::Install (or Module::Build) you can embed binary data in a __DATA__ section of a file like I've done in the file lib/Number/Phone/UK/Data.pm in my Number::Phone module. That file is a tiny piece of perl code which exposes the data that follows it as a hash, using DBM::Deep.
Just make sure you're careful when editing that file! In fact, it's best if you don't edit it. Auto-generate the header along with the data.
| [reply] [d/l] |
|