开发者

Setting up a common perl/cpan environment

开发者 https://www.devze.com 2022-12-25 09:22 出处:网络
so I\'m having a lot of fun with Perl at home for some time now. How开发者_开发知识库 much more difficult do things get when you develop Perl modules (In my case it\'s mostly catalyst) in a team? How

so I'm having a lot of fun with Perl at home for some time now.

How开发者_开发知识库 much more difficult do things get when you develop Perl modules (In my case it's mostly catalyst) in a team? How do we make sure we all got the same development environment (Perl/Module versions)? Simply by keeping up to date with CPAN? Do some teams setup their 'private' CPANs?


Using the following things should make your life easier.

check out local::lib you could easily then create a server that each member could sync these modules too.

You probably don't really want to mirror all of cpan. just the most recent modules which is why you'd use minicpan.

If you're using recommended modules in Task::Kensho then using the latest releases shouldn't be a problem as they should be surprisingly changing API on you. Basically by doing this you make sure you don't end up with your team reinventing the wheel or hopefully using 3 different modules that do the same thing.

And you want to make sure that your team uses good Perl coding practices and not the bad ones. There are a lot of bad ones. Read Perl Best Practices, remember it's just a guideline you should tune it too your team and your style.

  • local::lib

  • minicpan

  • Task::Kensho

  • Perl Best Practices


It is not exactly clear what is meant by "in a team".

If the team is at some company, the best solution is of course a shared directory where only the CPAN modules you need are installed.

If the team is a bunch of guys working collaboratively from their home computers, there are a couple of solutions.

One that comes to mind is as follows:

  • Have a shared "latest version of module to install" list in a file, accessible publicly from the web (on someone's home page, your favorite source control system, Google docs, whatever).

  • Write a little Perl script which retrieves that file from the web or checks it out of repository, loops over each CPAN module listed in the file, and verifies that locally installed version is the correct one. If upgrade is needed, have the script install update from CPAN.

  • Have that script run as a scheduled job (cron on Unix, or at/scheduler on Windows) as admin/root account, or at least account which has enough perms to install CPAN modules.

I won't provide details of script implementation, because I don't even know if this is for Windows or Unix, and doing all those tasks are fairly routine Perl coding - if you get stuck, you are always welcome to ask follow up questions on SO! :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号