Skip to content

Instantly share code, notes, and snippets.

@JJ
Last active January 6, 2017 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JJ/9826608 to your computer and use it in GitHub Desktop.
Save JJ/9826608 to your computer and use it in GitHub Desktop.
Install Git.pm in a perlbrew installation

Git.pm is a module that comes with git and can't be installed with the usual cpan magic. If you switch to perlbrew you'll get a Can't locate Git.pm error when you try to run it, so you need to install it explicitly if you want to use it in your own installation, mainly if you use perlbrew I use it in my novels for post-commit hooks, so here's what you have to do to have it available in your programs

bash$ cp /usr/share/perl5/Git.pm ~/perl5/perlbrew/perls/perl-5.x.y/lib/site_perl/5.x.y

you'll have to change x.y by the perl version you're actually using. You'll also need Error.pm, so do

bash$ cp /usr/share/perl5/Error.pm ~/perl5/perlbrew/perls/perl-5.x.y/lib/site_perl/5.x.y

And that's it!

@jluis
Copy link

jluis commented Mar 28, 2014

I have tested it using ln -s in place of cp and it works as it should my comands :

ln -s /usr/share/perl5/Error* perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/
ln -s /usr/share/perl5/Git* perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/

@JJ
Copy link
Author

JJ commented Jan 6, 2017

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment