Skip to content

Instantly share code, notes, and snippets.

@holybit
Created December 13, 2012 22:15
Show Gist options
  • Save holybit/4280559 to your computer and use it in GitHub Desktop.
Save holybit/4280559 to your computer and use it in GitHub Desktop.
Perl app questions
Have 2-3 perl modules in a lib dir at the top level of a git repo along with a bin dir and some other application dirs. The entire dir structure below exists in dev and is delivered to other target envs - tst and prd.
$ ls
lib/
bin/
t/
conf/
build/
app/darkpan
app/perl5
The bin/*.sh and bin/*.pl files are the entry point to the "applicaiton" and called from cron. lib/ has some home grown Perl modules.
Using Dist::Zilla primarily to resolve the prereqs of lib/, bin/ and t/ to create a dist of the apps Perl dependencies. It's sort of a Task distribution. Once built the dist is kept in app/darkpan.
Using local::lib and cpanm to install the distribution to app/perl5 for all envs - dev/tst/prd.
Questions:
1. Does having the dist install bin/ scripts to app/perl5 make sense? Cron jobs are pathed absolutely to bin/ script. Not keen to change those. Env is set correctly (PERL5LIB etc.) so the bin/ scripts know to get their Perl libs from app/perl5.
2. I need at least a lib/App/Foo.pm file if this is "just" a Task module. But what about the home grown modules in lib/? Should the dist install them to app/perl5? It's seems the right thing to do, but will be a PITA for developers working on lib/ modules. Every time they make a change they have to 'dzil build' and then install the code to app/perl5 just to run a bin/ script to check behavior. I could manipulate PERL5LIB just for dev env and add lib/ to it (i.e., already includes app/perl5) enabling simple edit lib/ files and run bin/ scripts behavior. But then why not just go whole hog and do the same for all envs and just keep the modules put in lib/ and never deliver them to app/perl5. What am I gaining by installing them to app/perl5?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment