FAQ
Apologies in advance if this is the wrong place to post.

I am setting up a new machine with Linux/Ubuntu v13.10 -- the first time
in nearly two years when I am using Linux as a desktop. I'm trying to
make a clean start with respect to my Perl-related programming practices:

* I want to use perlbrew as much as possible
* I want to use cpanm rather than cpan as much as possible

But I am having a hell of a time trying to get perlbrew to work in the
way I am accustomed to it working on my $job MacBook Pro.

I have (several times today) installed perlbrew with this command:

cpan
install App::perlbrew
I now have:

#####
which perlbrew
/usr/local/bin/perlbrew
#####

And I have added: 'source ~/perl5/perlbrew/etc/bashrc' to the end of my
~/.bash_profile file. (AAMOF, it's the only entry yet in that file.)

And I have said: 'perlbrew init'

The following commands work as expected:

#####
perlbrew available
perlbrew install perl-5.18.2
perlbrew list
#####

However, whenever I say:

######
perlbrew switch perl-5.18.2
######

I get:

#####
A sub-shell is launched with perl-5.18.2 as the activated perl. Run
'exit' to finish it.

bash-4.2$
#####

This is unexpected and undesired behavior. On the basis of using
perlbrew on my work laptop for > 1 year, I would *not* expect a
sub-shell to be opened. I would expect that, from the moment of
'perlbrew switch' forward, I would:

a) stay in the same shell
b) have 'perl -v' point to the 5.18.2 underneath my homedir.

On this new machine, when I am in the subshell, which perl -v gives
5.18.2. But when I exit, I'm back to the vendor perl.

'perldoc perlbrew' documents 'switch' as: Permanently use the specified
per as default.

That's the behavior I want. I don't want a subshell to be opened. I
want perlbrew switch perl-5.18.2 to make 5.18.2 my default perl.

Can anyone tell me what I'm doing wrong?

Thank you very much.
Jim Keenan

Search Discussions

  • Kent Fredric at Mar 22, 2014 at 6:04 pm

    On 23 March 2014 04:31, James E Keenan wrote:

    And I have added: 'source ~/perl5/perlbrew/etc/bashrc' to the end of my
    ~/.bash_profile file. (AAMOF, it's the only entry yet in that file.)

    This might be the cause, I have that stanza in ~/.bashrc instead

    And this seems to make a difference.

    Because ~/.bashrc is sourced each time bash is spawned, but ~/.bash_profile
    is only sourced under *login* shells, which means you have to do `bash -l`
    to load perlbrew into ENV

    And this matters, because without the perlbrew bashrc magic, `perlbrew
    switch` is a command, while with the perlbrew bashrc magic, `perlbrew` is a
    shell function.

    type -t perlbrew
    function

    --
    Kent
  • James E Keenan at Mar 22, 2014 at 6:24 pm

    On 3/22/14 1:04 PM, Kent Fredric wrote:
    On 23 March 2014 04:31, James E Keenanwrote:
    And I have added: 'source ~/perl5/perlbrew/etc/bashrc' to the end of my
    ~/.bash_profile file. (AAMOF, it's the only entry yet in that file.)

    This might be the cause, I have that stanza in ~/.bashrc instead

    And this seems to make a difference.
    Thanks, Kent. I got your post just after I stumbled on the same thing
    and posted to the list.

    Thank you very much.
    Jim Keenan
  • James E Keenan at Mar 22, 2014 at 6:23 pm
    On 3/22/14 10:31 AM, James E Keenan wrote:
    [snip]
    And I have added: 'source ~/perl5/perlbrew/etc/bashrc' to the end of my
    ~/.bash_profile file. (AAMOF, it's the only entry yet in that file.)
    Adding that 'source' line to my .bash_profile appeared to be
    ineffective. However, when I added it to the end of ~/.bashrc, then
    called 'source ~/.bashrc', 'perlbrew switch perl-5.18.2' DWIMmed.

    http://perlbrew.pl/Release-0.29.html appears to suggest that this is a
    recent modification to perlbrew's behavior.

    If anyone can confirm that this diagnosis/correction is optimal, that
    would be appreciated.

    Thank you very much.
    Jim Keenan
  • Aristotle Pagaltzis at Mar 22, 2014 at 7:40 pm

    * James E Keenan [2014-03-22 19:25]:
    http://perlbrew.pl/Release-0.29.html appears to suggest that this
    is a recent modification to perlbrew's behavior.
    Uhm, for rather relative values of “recent”: 0.29 is 2½ years old as
    of this writing, and was released when perlbrew was just 1½ years old.
    The current version is 0.67.

    --
    Aristotle Pagaltzis // <http://plasmasturm.org/>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcpan-workers @
categoriesperl
postedMar 22, '14 at 3:31p
activeMar 22, '14 at 7:40p
posts5
users3
websitecpan.org

People

Translate

site design / logo © 2018 Grokbase