{"id":2392,"date":"2010-07-02T10:14:00","date_gmt":"2010-07-02T10:14:00","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/Hayek\/Jochen\/wp\/blog-en\/2010\/07\/02\/appperlbrew-manage-perl-installations-in-your-home-or-wherever-you-want\/"},"modified":"2010-07-02T10:14:00","modified_gmt":"2010-07-02T10:14:00","slug":"appperlbrew-manage-perl-installations-in-your-home-or-wherever-you-want","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2010\/07\/02\/appperlbrew-manage-perl-installations-in-your-home-or-wherever-you-want\/","title":{"rendered":"App::perlbrew &#8211; Manage perl installations in your $HOME or wherever you want"},"content":{"rendered":"<div>Prerequisites:<\/div>\n<div>\n<ul>\n<li><span>$\u00a0zypper install patch<\/span><\/li>\n<li><span>$\u00a0zypper install gcc<\/span><\/li>\n<li>\u2026<\/li>\n<\/ul>\n<div>Caveat:<\/div>\n<\/div>\n<div>\n<ul>\n<li>yes, &#8220;<span>perlbrew install<\/span>&#8221; occasionally and too often \u00a0needs &#8220;<span>&#8211;force<\/span>&#8221; and even\u00a0&#8220;<span>&#8211;notest<\/span>&#8220;, don&#8217;t be too surprised! my &#8220;5.14.2&#8221; and also my &#8220;5.16.1&#8221; needed it<\/li>\n<li>\u2026<\/li>\n<\/ul>\n<\/div>\n<div><\/div>\n<div>Main links:<\/div>\n<ul>\n<li><a href=\"http:\/\/perlbrew.pl\/\">www.perlbrew.pl<\/a><\/li>\n<li><span><span>$ perlbrew<\/span><\/span><\/li>\n<li><span><span>$ perlbrew help<\/span><\/span><\/li>\n<li><a href=\"http:\/\/search.cpan.org\/perldoc?App::perlbrew\">http:\/\/search.cpan.org\/perldoc?App::perlbrew<\/a><span>\u00a0\u2013 this one tells you, how to upgrade perlbrew:<\/span><\/li>\n<\/ul>\n<div>\n<blockquote><p>\n<span>$ export PERLBREW_ROOT=\/opt\/perlbrew<br \/>\n$ curl -kL http:\/\/install.perlbrew.pl | bash<br \/>\n# or maybe like this:<br \/>\n$ perlbrew self-upgrade<\/span><\/p><\/blockquote>\n<\/div>\n<ul>\n<li><a href=\"https:\/\/metacpan.org\/module\/App::perlbrew\">https:\/\/metacpan.org\/module\/App::perlbrew<\/a><\/li>\n<li><a href=\"https:\/\/metacpan.org\/module\/perlbrew\">https:\/\/metacpan.org\/module\/perlbrew<\/a> : list-modules, how to migrate modules together with cpanm, \u2026<\/li>\n<li><a href=\"http:\/\/www.perl.org\/pub\/2010\/03\/testing-perl-5120-rc-1-with-appperlbrew.html\">http:\/\/www.perl.org\/pub\/2010\/03\/testing-perl-5120-rc-1-with-appperlbrew.html<\/a>\u00a0(a little outdated)<\/li>\n<li><span>Perlbrew and my shebang line<\/span><span>\u00a0<\/span><span>[<\/span><a href=\"https:\/\/github.com\/gugod\/App-perlbrew\/wiki\/Release-0.22\">Link<\/a><span>]<\/span><span>:<\/span><\/li>\n<\/ul>\n<div>T<span>he developer\/maintainer does not have in mind this use case as the <b>main<\/b> use case!! But it is <b>my<\/b> main use case.<\/span><br \/>\nWhat to do after installing a new perl, that you consider your new stable perl?<\/p>\n<blockquote><p><span>$ perlbrew alias create perl-RELEASE stable<\/span><\/p><\/blockquote>\n<blockquote><p><span> # resp.<br \/>\n$ perlbrew alias -f create perl-RELEASE stable<br \/>\n# use this shebang line with $PERLBREW_ROOT expanded [<a href=\"http:\/\/www.perlbrew.pl\/Release-0.22.html\">Link<\/a>]:<br \/>\n#! $PERLBREW_ROOT\/perls\/stable\/bin\/perl<\/span><\/p>\n<p>$ perlbrew switch stable # <b>this will be our usual starting point!!!<\/b><\/p><\/blockquote>\n<blockquote><p><span># but &#8220;perlbrew list-modules&#8221; does not work on such an alias, so &#8220;perlbrew use&#8221; to a non-alias before!<br \/>\n<\/span><\/p><\/blockquote>\n<div>\n<ul>\n<li><span>Have a serious look at &#8220;<\/span><span>$ perlbrew help<\/span><span>&#8221; once in a while!!!<\/span><\/li>\n<\/ul>\n<\/div>\n<p><span><br \/>\n<\/span><br \/>\n<span>I decided to make use of <\/span><span>$PERLBREW_ROOT<\/span><span>, as I want to keep my home <\/span><span>$HOME<\/span><span> minimial, just data and scripts, no big files, they all go to other disks. And right, my home directory is on an encrypted partition, and this sort of stuff certainly does not get encrypted.<\/span><\/p>\n<blockquote><p><span>$ export PERLBREW_ROOT=\/usr\/local\/perlbrew<\/span><\/p><\/blockquote>\n<p><span>Therefore my perlbrew is installed as:<\/span><\/p>\n<blockquote><p><span><span>\/usr\/local\/perlbrew\/bin\/perlbrew<\/span><\/span><\/p><\/blockquote>\n<p><span>They suggest, that my <span><span>$HOME\/.bashrc<\/span><\/span> should &#8220;<span>source<\/span>&#8221; their <span><span>&#8230;\/etc\/bashrc<\/span><\/span>, but for the time being I let my <span><span>$HOME\/.profile<\/span><\/span> do this, as IMHO this is right place.<\/span><br \/>\n<span>So actually this is according to <i>best practices for shell programming<\/i> the right way (for me) to do it, and now this code is of course included in my <span><span>$HOME\/.profile<\/span><\/span>:<\/span><br \/>\n<span><br \/>\n<\/span><br \/>\n<span><span><span># for perl&#8217;s App::perlbrew :<\/span><\/span><\/span><br \/>\n<span><span><span>export\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PERLBREW_ROOT=\/usr\/local\/perlbrew # on my Linux boxes<\/span><\/span><\/span><br \/>\n<span><span><span>export\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PERLBREW_ROOT=\/sw\/perlbrew # on my Mac box(es)<\/span><\/span><\/span><br \/>\n<span><span><span>source\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $PERLBREW_ROOT\/etc\/bashrc<\/span><\/span><\/span><br \/>\n<span><span><span>##export\u00a0 PATH=$PERLBREW_ROOT\/bin:$PERLBREW_ROOT\/perls\/current\/bin:${PATH}<\/span><\/span><\/span><br \/>\n<span><span><span>path_prepend\u00a0\u00a0 $PERLBREW_ROOT<\/span><\/span><\/span><br \/>\n<span><span><span>path_prepend\u00a0\u00a0 $PERLBREW_ROOT\/perls\/current<\/span><\/span><\/span><br \/>\n<span><br \/>\n<\/span><br \/>\n<span>BTW: always &#8220;<\/span><span><span>$ hash -r<\/span><\/span><span>&#8221; after switching, so you avoid getting certain perl resp. perlbrew related error messages like this one and a few others (confusion of the right installation directory):<\/span><\/p>\n<blockquote><p><span><span>bash: \u2026: No such file or directory<\/span><\/span><\/p><\/blockquote>\n<p><span>I successfully brewed 5.10.1 and 5.12.1 on openSUSE-11.2, but on OS X Snow Leopard I only brewed 5.12.1 successfully, brewing 5.10.1 failed.<\/span><br \/>\n<span><br \/>\n<\/span><br \/>\n<span>To be continued \u2026<\/span><br \/>\n<span><br \/>\n<\/span><br \/>\n<span>Update 2011-10-16:<\/span><br \/>\n<span>On my Mac running Lion I was able to perlbrew these releases of perl<\/span><\/p>\n<ul>\n<li>perl-5.15.3 and<\/li>\n<li>perl-5.14.2<\/li>\n<li>but not perl-5.12.4, 5.10.1, 5.8.9, 5.6.2<\/li>\n<\/ul>\n<div>but that seems more than sufficient to me.<\/div>\n<p><span>Looks like OS X got targeted as a serious platform for perl development only rather recently.<\/span><br \/>\n<span>\u2026<\/span><br \/>\n<span><br \/>\n<\/span><br \/>\nUpdate 2012-10-07: A historic note: I first looked into perlbrew in the context of &#8220;biz-JG&#8221;.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Prerequisites: $\u00a0zypper install patch $\u00a0zypper install gcc \u2026 Caveat: yes, &#8220;perlbrew install&#8221; occasionally and too often \u00a0needs &#8220;&#8211;force&#8221; and even\u00a0&#8220;&#8211;notest&#8220;, don&#8217;t be too surprised! my &#8220;5.14.2&#8221; and also my &#8220;5.16.1&#8221; needed it \u2026 Main links: www.perlbrew.pl $ perlbrew $ perlbrew help http:\/\/search.cpan.org\/perldoc?App::perlbrew\u00a0\u2013 this one tells you, how to upgrade perlbrew: $ export PERLBREW_ROOT=\/opt\/perlbrew $ curl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[666],"tags":[921],"class_list":["post-2392","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-biz-jg"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-CA","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/2392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=2392"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/2392\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=2392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=2392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=2392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}