Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jozef (8299)

jozef
  (email not shown publicly)
http://jozef.kutej.net/
Jabber: jozef@kutej.net

Journal of jozef (8299)

Tuesday December 29, 2009
11:59 AM

Just put it where it belongs

[ #40055 ]

Still there after reading this and this?. What I would like to show next is Module::Build::SysPath and the usage for CPAN authors. What are the features?

  • pre/post install paths (dev+test/prod)
  • system paths configured once when Sys::Path is installed
  • "Debian way" of handling configuration files
  • automatic all files copying
  • creating of empty folders (for state, log, etc. files)

The main reason for existence is to install files (configuration, templates, data files, ...) where FHS recommends and also to know where to put temporary files (like state, lock, cache, ...).

There are couple of stages that the CPAN distribution is going through. Development, smoke testing, pre install and install stage. In all of those it is good to know where our files are. :-P Before the final install the files are always inside the distribution folder, only after install the files are in the system folders. There for the Module::Build::SysPath requires a special module YouModuleName::SPc that gets overwritten with values from Sys::Path once installed.

There are, as always, couple of other ways how to store and work with non-perl modules files. Here are some that I'm aware of:

  • storing data inside __DATA__ in .pm file
  • storing files in the same folder as .pm files
  • storing files in auto/ - File::ShareDir
  • hardcoded system folders
  • use Sys::Path paths directly
  • ???

Everyone can choose.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.