<commit_before>#perl -C -le 'print map{chr}0151,32,0x2764,040,map{ord}split//,($^X=~m#([^/\\]+)$#)[0]'

#export HARNESS_SUBCLASS=TAP::Harness::Restricted

export NOPASTE_NICK=rwstauner
export NOPASTE_SERVICES='Gist Shadowcat Pastie Snitch'

shadowpaste () {
  # TODO: connect to channel and /invite shadowpaste
  nopaste -s Shadowcat -c "$1" ${2:+-d "$2"};
}

cpan () {
  if [[ $# -eq 0 ]]; then
    command cpan "$@"
  else
    # No prompts.
    command cpan "$@" < /dev/null
  fi
  # Rehash any installed scripts.
  if which plenv &> /dev/null; then plenv rehash; fi
}

# LWP 6.00 breaks CPAN::Reporter (when using Metabase Transport)
# cert purchased on 2011/03/15
#alias cpan='env PERL_LWP_SSL_VERIFY_HOSTNAME=0 cpan'

# get the PERL5LIB, but don't set the install paths (cpanm handles that)
# usage of local::lib is currently undecided thanks to perlbrew...
#eval $(perl -Mlocal::lib | grep PERL5LIB)
#eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)

#export PERL_UNICODE=AS

export PLENV_ROOT="$HOME/perl5/plenv"
if [[ -d "$PLENV_ROOT" ]]; then
  add_to_path "$PLENV_ROOT/bin"
  eval "$(plenv init -)"

# Only load the default perlbrew environment if perlbrew isn't already in use.
elif [[ -z "$PERLBREW_PERL" ]]; then

for pbparent in $HOME/perl5 /opt/perl5 /opt /usr/local; {
  perlbrewrc="$pbparent/perlbrew/etc/bashrc"
  [[ -r "$perlbrewrc" ]] && { source "$perlbrewrc"; break; }
}
unset pbparent

fi

# after perlbrew
which setup-bash-complete &> /dev/null && . setup-bash-complete

# TODO: make a symlink to the newest perl in ~/perl5/

# dzil aliases
  dzil () {
    case "$1" in
      new)
        echo "$*" | grep -E -- '-P .+' || { echo 'use -P!'; return 1; };
        command dzil "$@";;
      installm)
        local dest=""
        if grep -F '@AutoLookout' dist.ini; then dest="$HOME/perl5-autolookout"; fi
        command dzil install --install-command="cpanm -v -i . ${dest:+-l }$dest";;
      *)
        command dzil "$@";;
    esac
  }

# shell aliases for perl commands
alias buzzword='perl -MAcme::MetaSyntactic=buzzwords -le "print metaname"'
alias gmstamp='perl -le '\''use Time::Stamp q[gmstamp].($ARGV[0]=~/^-/?shift(@ARGV):q[]) => @ARGV?{@ARGV}:(); print gmstamp'\'' --'
#alias date-iso8601='perl -MTime::Stamp=gmstamp -le print+gmstamp'

# thanks oalders!
alias penv='perl -MDDP -e "p(%ENV)"'

alias alternate='perl -ne "print( qq/\033[/ . ( \$. % 2 ? q/33/ : q/36/ ). q/m/ . \$_ . qq/\033[0m/ );"'

which base64 &> /dev/null || \
  alias base64='perl -MMIME::Base64 -0777 -sne "print \$d ? decode_base64(\$_) : encode_base64(\$_)" --'

# sometimes perldoc doesn't like en_US.utf8<commit_msg>Define alias for using plenv through docker<commit_after>#perl -C -le 'print map{chr}0151,32,0x2764,040,map{ord}split//,($^X=~m#([^/\\]+)$#)[0]'

#export HARNESS_SUBCLASS=TAP::Harness::Restricted

export NOPASTE_NICK=rwstauner
export NOPASTE_SERVICES='Gist Shadowcat Pastie Snitch'

shadowpaste () {
  # TODO: connect to channel and /invite shadowpaste
  nopaste -s Shadowcat -c "$1" ${2:+-d "$2"};
}

cpan () {
  if [[ $# -eq 0 ]]; then
    command cpan "$@"
  else
    # No prompts.
    command cpan "$@" < /dev/null
  fi
  # Rehash any installed scripts.
  if which plenv &> /dev/null; then plenv rehash; fi
}

# LWP 6.00 breaks CPAN::Reporter (when using Metabase Transport)
# cert purchased on 2011/03/15
#alias cpan='env PERL_LWP_SSL_VERIFY_HOSTNAME=0 cpan'

# get the PERL5LIB, but don't set the install paths (cpanm handles that)
# usage of local::lib is currently undecided thanks to perlbrew...
#eval $(perl -Mlocal::lib | grep PERL5LIB)
#eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)

#export PERL_UNICODE=AS

export PLENV_ROOT="$HOME/perl5/plenv"
if [[ -d "$PLENV_ROOT" ]]; then
  add_to_path "$PLENV_ROOT/bin"
  eval "$(plenv init -)"
fi

alias dplenv='drun --ssh -v plenv:/opt/plenv -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa -v $HOME/.pause:/root/.pause -v $HOME/.gitconfig:/root/.gitconfig --tmpfs /src/.build rwstauner/plenv'

# dzil aliases
  dzil () {
    case "$1" in
      new)
        echo "$*" | grep -E -- '-P .+' || { echo 'use -P!'; return 1; };
        command dzil "$@";;
      installm)
        local dest=""
        if grep -F '@AutoLookout' dist.ini; then dest="$HOME/perl5-autolookout"; fi
        command dzil install --install-command="cpanm -v -i . ${dest:+-l }$dest";;
      *)
        command dzil "$@";;
    esac
  }

# shell aliases for perl commands
alias buzzword='perl -MAcme::MetaSyntactic=buzzwords -le "print metaname"'
alias gmstamp='perl -le '\''use Time::Stamp q[gmstamp].($ARGV[0]=~/^-/?shift(@ARGV):q[]) => @ARGV?{@ARGV}:(); print gmstamp'\'' --'
#alias date-iso8601='perl -MTime::Stamp=gmstamp -le print+gmstamp'

# thanks oalders!
alias penv='perl -MDDP -e "p(%ENV)"'

alias alternate='perl -ne "print( qq/\033[/ . ( \$. % 2 ? q/33/ : q/36/ ). q/m/ . \$_ . qq/\033[0m/ );"'

which base64 &> /dev/null || \
  alias base64='perl -MMIME::Base64 -0777 -sne "print \$d ? decode_base64(\$_) : encode_base64(\$_)" --'

# sometimes perldoc doesn't like en_US.utf8
{'fraction_non_alphanumeric': 0.1839856944168488, 'fraction_numerical': 0.02880985495728194, 'mean_word_length': 3.4119193689745835, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3987107', 'n_tokens_mistral': 2120, 'n_tokens_neox': 1957, 'n_words': 494}