Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Distributing binary data along with a CPAN module

by adamk (Chaplain)
on Feb 22, 2008 at 02:34 UTC ( #669449=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: Distributing binary data along with a CPAN module
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://669449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2015-07-04 23:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls