Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Distributing binary data along with a CPAN module

by adamk (Chaplain)
on Feb 22, 2008 at 02:34 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://669449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found