SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-04-10 11:58:22

Probe34
Member
Registered: 2012-09-25
Posts: 42

Installing perlbrew

Trying to gain some insight in Perl, I installed perlbrew. That worked but look at the message during installation:

## Download the latest perlbrew

## Installing perlbrew
perlbrew is installed: ~/perl5/perlbrew/bin/perlbrew

perlbrew root (~/perl5/perlbrew) is initialized.

Append the following piece of code to the end of your ~/.bash_profile and start a
new shell, perlbrew should be up and fully functional from there:

    source ~/perl5/perlbrew/etc/bashrc

Simply run `perlbrew` for usage details.

Happy brewing!

## Installing patchperl

## Done.

So, I open thunar/hidden files, but the file ~/.bash_profile isn't there. Should it be there? Must I make a new file?

The only bash_profile that can be found on my system is:
/usr/share/doc/adduser/examples/adduser.local.conf.examples/skel/dot.bash_profile

Offline

Be excellent to each other!

#2 2013-04-10 12:01:22

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Installing perlbrew

Make a new file.

Offline

#3 2013-04-10 12:12:18

Probe34
Member
Registered: 2012-09-25
Posts: 42

Re: Installing perlbrew

I did. Added:
source ~/perl5/perlbrew/etc/bashrc to it.
Then I ran perlbrew.

ecmporter@peek:~$ perlbrew
bash: perlbrew: command not found

And it failed.

Offline

#4 2013-04-10 12:15:45

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Installing perlbrew

You should logout and login again, or source the file manually once.

Offline

#5 2013-04-10 12:24:52

Probe34
Member
Registered: 2012-09-25
Posts: 42

Re: Installing perlbrew

I logged out and logged in. Opened terminal:

ecmporter@peek:~$ perlbrew
bash: perlbrew: command not found

Last edited by Probe34 (2013-04-10 12:25:19)

Offline

#6 2013-04-10 12:35:23

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Installing perlbrew

Post output of

cat ~/perl5/perlbrew/etc/bashrc

Offline

#7 2013-04-10 12:37:05

Probe34
Member
Registered: 2012-09-25
Posts: 42

Re: Installing perlbrew

export PERLBREW_BASHRC_VERSION=0.62


__perlbrew_reinit() {
    if [[ ! -d "$PERLBREW_HOME" ]]; then
        mkdir -p "$PERLBREW_HOME"
    fi

    echo '# DO NOT EDIT THIS FILE' > "$PERLBREW_HOME/init"
    command perlbrew env $1 | \grep PERLBREW_ >> "$PERLBREW_HOME/init"
    . "$PERLBREW_HOME/init"
    __perlbrew_set_path
}

__perlbrew_set_path () {
    MANPATH_WITHOUT_PERLBREW=`perl -e 'print join ":", grep { index($_, $ENV{PERLBREW_HOME}) < 0 } grep { index($_, $ENV{PERLBREW_ROOT}) < 0 } split/:/,qx(manpath 2> /dev/null);'`
    if [ -n "$PERLBREW_MANPATH" ]; then
        export MANPATH="$PERLBREW_MANPATH:$MANPATH_WITHOUT_PERLBREW"
    else
        export MANPATH="$MANPATH_WITHOUT_PERLBREW"
    fi
    unset MANPATH_WITHOUT_PERLBREW

    PATH_WITHOUT_PERLBREW=$(eval $perlbrew_command display-pristine-path)
    if [ -n "$PERLBREW_PATH" ]; then
        export PATH=${PERLBREW_PATH}:${PATH_WITHOUT_PERLBREW}
    else
        export PATH=${PERLBREW_ROOT}/bin:${PATH_WITHOUT_PERLBREW}
    fi
    unset PATH_WITHOUT_PERLBREW

    hash -r
}

__perlbrew_set_env() {
    local code="$($perlbrew_command env $@)"
    local exit_status="$?"
    if [[ $exit_status -eq 0 ]] ; then
        eval "$code"
    else
        return $exit_status
    fi
}

__perlbrew_activate() {
    [[ -n $(alias perl 2>/dev/null) ]] && unalias perl 2>/dev/null

    if [[ -n "$PERLBREW_PERL" ]]; then
        if [[ -z "$PERLBREW_LIB" ]]; then
            __perlbrew_set_env $PERLBREW_PERL
        else
            __perlbrew_set_env $PERLBREW_PERL@$PERLBREW_LIB
        fi
    fi

    __perlbrew_set_path
}

__perlbrew_deactivate() {
    __perlbrew_set_env
    unset PERLBREW_PERL
    unset PERLBREW_LIB
    __perlbrew_set_path
}

perlbrew () {
    local exit_status
    local short_option
    export SHELL

    if [[ $1 == -* ]]; then
        short_option=$1
        shift
    else
        short_option=""
    fi

    case $1 in
        (use)
            if [[ -z "$2" ]] ; then
                if [[ -z "$PERLBREW_PERL" ]] ; then
                    echo "Currently using system perl"
                else
                    echo "Currently using $PERLBREW_PERL"
                fi
            else
                __perlbrew_set_env "$2"
                exit_status="$?"
                if [[ $exit_status -eq 0 ]]
                then
                    __perlbrew_set_path
                fi
            fi
            ;;

        (switch)
              if [[ -z "$2" ]] ; then
                  command perlbrew switch
              else
                  perlbrew use $2
                  exit_status=$?
                  if [[ ${exit_status} -eq 0 ]]; then
                      __perlbrew_reinit $2
                  fi
              fi
              ;;

        (off)
            __perlbrew_deactivate
            echo "perlbrew is turned off."
            ;;

        (switch-off)
            __perlbrew_deactivate
            __perlbrew_reinit
            echo "perlbrew is switched off."
            ;;

        (*)
            command perlbrew $short_option "$@"
            exit_status=$?
            ;;
    esac
    hash -r
    return ${exit_status:-0}
}

[[ -z "$PERLBREW_ROOT" ]] && export PERLBREW_ROOT="$HOME/perl5/perlbrew"
[[ -z "$PERLBREW_HOME" ]] && export PERLBREW_HOME="$HOME/.perlbrew"

if [[ ! -n "$PERLBREW_SKIP_INIT" ]]; then
    if [[ -f "$PERLBREW_HOME/init" ]]; then
        . "$PERLBREW_HOME/init"
    fi
fi

perlbrew_bin_path="${PERLBREW_ROOT}/bin"
if [[ -f $perlbrew_bin_path/perlbrew ]]; then
    perlbrew_command="$perlbrew_bin_path/perlbrew"
else
    perlbrew_command="command perlbrew"
fi
unset perlbrew_bin_path

__perlbrew_activate

Offline

#8 2013-04-10 12:38:57

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: Installing perlbrew

Restart X should probably work.

Offline

#9 2013-04-10 12:52:22

Probe34
Member
Registered: 2012-09-25
Posts: 42

Re: Installing perlbrew

Done: ALT+PRNTSCREEN+K. Opened a terminal. Run perlbrew. None.

Offline

#10 2013-04-10 13:25:35

Probe34
Member
Registered: 2012-09-25
Posts: 42

Re: Installing perlbrew

Is the file a bash-script? So,  #!/bin/bash at the beginning? and sudo chmod +x [file] in the terminal afterwards?

Last edited by Probe34 (2013-04-10 13:26:02)

Offline

#11 2013-04-10 16:25:03

Probe34
Member
Registered: 2012-09-25
Posts: 42

Re: Installing perlbrew

Have done some thinking of myself.  big_smile  Of course it is a bash script.

~/perl5/perlbrew/bin/perlbrew works in the terminal

A soft link to /usr/bin/ should do the trick. But if anyone could find out why the instructions of the program itself doesn't work, I would be much obliged.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo